Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: InCreator on Sat 28/02/2004 19:48:22

Title: Problem with custom Inventory GUI
Post by: InCreator on Sat 28/02/2004 19:48:22
When using custom GUI for inventory, speech text appears to be behind (or under?) GUI, only way to work around is to use DisplayAt to pull text somewhere else, so GUI won't cover it. Weird?
Suggestion here, too - "Inventory uses GUI <number>" option to general settings, which atomatically solves the problem then, or will just assign custom GUI to InventoryScreen function.
Title: Re:Problem with custom Inventory GUI
Post by: Ben on Sat 28/02/2004 20:56:21
Hmm.. The best way to solve the problem would be to have a script that can set the area in which speeck text can appear. So you could do something like SetTextBounds(top,bottom,left,right); and all the text would display in that area..
Title: Re: Problem with custom Inventory GUI
Post by: hedgefield on Mon 24/01/2005 17:58:17
I have the exact same problem.
I don't see how a text area can solve this problem, since the text is displayed normally, but the GUI is covering it. Mind you, this doesn't just apply to the speech text, it also applies to the overlay on my mouse pointer showing objects' names, and thus here the names of the inventory items.
And I didn't create a new GUI, I modified the graphics on the default Inventory GUI.

What makes a custom (Inventory) GUI different from the normal GUI that text appears behind it?


P.S. I apologise in advance, I know this thread is old, but it's the only one dealing with this problem and I haven't been able to find a solution any other way.
Title: Re: Problem with custom Inventory GUI
Post by: Scorpiorus on Wed 26/01/2005 11:56:53
QuoteWhat makes a custom (Inventory) GUI different from the normal GUI that text appears behind it?
I think it's not the case with the custom inventory GUI in particular but with GUIs in general. Overlays and subsequently text speech are drawn behind GUIs.

There is a tracker entry: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=256

As for a workaround, you can create another GUI with a label to display the text:

repeatedly_execute:

SetLabelText(UNDER_CURSOR_INFO_GUI, label, <location name here>);

SetGUIPosition(UNDER_CURSOR_INFO_GUI, mouse.x, mouse.y);

Let us know how it turns out.
Title: Re: Problem with custom Inventory GUI
Post by: hedgefield on Thu 27/01/2005 17:05:50
Well I'm not that familiar with all the coding stuff in AGS (yet), so I personally will wait and see what Chris comes up with in due time, now that I know the issue is on the to-do list.

As for an easier work-around, the look responses for the Inv items are in  the Global Messages. This way it displays on top of the GUI. And I changed the Y value of my pointer overlay a little so most of it comes out above the GUI when I move my mouse over an item. I've only got the top row filled with items so far, so it's not that bad. It'll take a long while before I release my game anyway, so I'm sure the issue will be solved by then.
Title: Re: Problem with custom Inventory GUI
Post by: LeChuck on Tue 22/02/2005 14:00:45
Here's how I solved it:

Defined in main global script file:
int textId;

When looking at an item, run this script:
textId = CreateTextOverlay(int x, int y, int width, int font, int colour, string text);
SetGlobalInt(24, 1); //Choose a free global integer here.

In repeatedly execute:
if (GetGlobalInt(24)==1) {WaitMouseKey(100); RemoveOverlay(textId); SetGlobalInt(24, 0);}


It looks and acts just like normal text. It won't show on top of your GUI, but you do have the possibility to control where to show the text. I chose to view it right under the inventory GUI.