I Want Inventory GUI to Always Show

Started by Lior, Sat 13/01/2024 21:55:52

Previous topic - Next topic

Lior

Hi,
I want to always see my inventory GUI during the game.
meaning, in each room the characther goes, i can always see the inventory items in the room itself without needing to open the inventory GUI.

There are games with the same concept, the invetory items at the bottom of the screen, like in:
"Putt-Putt Joins The Parade", and "Fatty Bear's Birthday Surprise".

Can it be done in AGS?

Rik_Vargard

What I would do is go to the "Explore project" (on the right in the editor just above "Plugins") > "Scripts" > "Global Script" >"Edit Script".
Then go to line 78 or so (where it says "function repeatedly_execute()"

And in there I would type:

gInventory.Visible = true;



Cassiebsg

#2
That's actually a bad solution.
Remember that anything you place in  repeatedly_execute, will run 40 times a second (assuming the game is running at the  default of 40 FPS).

Just open your GUI, assuming that it's called gInventory and on it's properties, under Appearance, turn PopupStyle to Normal (or Always show) and Visible to true.

Now unless you code it to close it should be on all the time.

If you're using a specific Template that is set to hide it, then please say which template, so we can tell where to fix it.
There are those who believe that life here began out there...

eri0o

If you are using the BASS template, if you navigate to the GUI in the Editor, there is a property called PopupStyle and you can set it to Normal, and in visible set it to true.

Some info is here:
 https://adventuregamestudio.github.io/ags-manual/EditorGUI.html

Lior

I've changed PopupStyle to Normal, and code gInventory.Visible = true.
It seems to work.
Thanks!  :smiley:

eri0o

Just to reiterate what Cassiebsg mentioned, you really should not run gInventory.Visible = true in repeatedly execute always. If you never call such you can just mark it's property as visible in the Editor - or even use Always Shown. Of course you may have some screen where you don't want the inventory to show, than you can just set it's Visible property to false in script when loading your title screen and then to true when the game "starts" - say, in the after fade-in of your first room.

SMF spam blocked by CleanTalk