Wintermute Engine > Technical forum

Inventory and response area always on top

<< < (2/5) > >>

NAItReIN:
Hi muties,
please, download this file: https://www.dropbox.com/s/6mz8frfvo1bzs6t/IndraAnagram.rar?dl=0

I hope it will help  :)

Indra Anagram:

--- Quote from: NAItReIN on November 17, 2017, 01:04:47 AM ---Hi muties,
please, download this file: https://www.dropbox.com/s/6mz8frfvo1bzs6t/IndraAnagram.rar?dl=0

I hope it will help  :)

--- End quote ---

Hey NAItReIN! I am deeply sorry, but the .rar archieve cannot be opened (at least I can't do that) - "File is damaged" and "Unsupported format" messages show. Could you please re-upload it to Dropbox or make it .zip instead? THANK YOU for your reply and desire to help!

NAItReIN:
Hi Indra Anagram,
here you are: https://www.dropbox.com/s/636g98o4ktdal48/IndraAnagram.zip?dl=0

I hope it will help to solve your problems.

Indra Anagram:

--- Quote from: NAItReIN on November 17, 2017, 10:00:37 AM ---I hope it will help to solve your problems.

--- End quote ---

It HAS solved my problems, NAItReIN! Worked like a charm. 

Now the inventory is always at the bottom of screen and whenever responses show up, the background changes!

Just like in the game that is my inspiration, yay! :)

I was thinking about anarchist's advice:


--- Quote ---I guess you can use inventoryWindow.SetImage() to change the background.
--- End quote ---

Because I want the inventory become darkened (change background) during scripted things, I guess InventoryWindow.SetImage should be used with


--- Code: WME Script ---if (Game.Interactive = false){ }
How do I deal with the command? Should I make it a variable? Have tried this and got nothing.

BIG THANKS to you for your kind attention and the archive!

NAItReIN:

--- Quote ---Because I want the inventory become darkened (change background) during scripted things, I guess InventoryWindow.SetImage should be used with
--- End quote ---

You can get the reference to inventory window by this way:

--- Code: ---global WinInventoryWindow = Game.GetInventoryWindow();
--- End code ---

But how to solve your problem? See my solution:

game.script

--- Code: WME Script ---// we need to store reference to window in global variable because we will use it in other script// inventory dark window does exist, but it is not visible global InventoryWinDark = Game.CreateWindow();InventoryWinDark.SetImage("interface\inventory_dark.sprite");InventoryWinDark.X = 0;InventoryWinDark.Y = 510;
game_loop.script

--- Code: WME Script ---#include "scripts\base.inc" global InventoryWinDark;global WinCaption;global WinMenu; // infinite loopwhile(true){   // save the active object for later  var ActObj = Game.ActiveObject;   // handle the standard foating caption  if(Game.Interactive && ActObj!=null)  {    if (Game.SelectedItem==null)    {      WinCaption.X = Game.MouseX;      WinCaption.Y = Game.MouseY + 20;      WinCaption.TextAlign = TAL_LEFT;      WinCaption.Text = ActObj.Caption;       // keep the caption on screen      WinCaption.SizeToFit();      if(WinCaption.X + WinCaption.Width > Game.ScreenWidth) WinCaption.X = Game.ScreenWidth - WinCaption.Width;      if(WinCaption.Y + WinCaption.Height > Game.ScreenHeight) WinCaption.Y = Game.ScreenHeight - WinCaption.Height;      }    // handle the caption when you want to use an object with another    else {      var Item = Game.SelectedItem;       WinCaption.X = 0;      WinCaption.Y = 580;      WinCaption.Width = Game.ScreenWidth;      WinCaption.TextAlign = TAL_CENTER;      WinCaption.Text = "Use " + Item.Caption + " with " + ActObj.Caption;    }    WinCaption.Visible = true;    WinCaption.Focus();  }  else WinCaption.Visible = false;    // this is what we need  if(Game.Interactive==false && Game.ResponsesVisible == false)  {    WinInventoryWinDark.Visible = true;  }  else    WinInventoryWinDark.Visible = false;    // go to sleep for 20 miliseconds to allow the engine to perform other tasks  // it is important for the "endless" scripts to call the Sleep command, otherwise the game will get stuck  Sleep(20);}
 :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version