Problem with custom Inventory GUI

Started by InCreator, Sat 28/02/2004 19:48:22

Previous topic - Next topic

InCreator

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.

Ben

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..

hedgefield

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.

Scorpiorus

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.

hedgefield

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.

LeChuck

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.

SMF spam blocked by CleanTalk