Inventory window issue [SOLVED]

Started by Axelord1942, Sat 03/02/2018 21:21:47

Previous topic - Next topic

Axelord1942

Trying to sort out my inventory gui.  Currently all my items seem jumbled together, do I have to make the sprites smaller or what?

Problem in question

Additionally, I tried having an inventory window in the icon bar, Space Quest style, but so far all it does is show me all my items all jumbled together in the one window so I've just temporarily removed it.  Do I have to use some ActiveInventory script to get that working right?

This is a debug room, so I'm not worried about character scale or anything like that in here, just use this place to test out my animations.  Thanks in advance.  I've been scouring the forums on and off while working but I haven't found this specific issue yet.  I'll keep looking and update if I find it.
You have been eaten by a Gru

Crimson Wizard

#1
Regarding items stacked up - you need to set up ItemWidth and ItemHeight properties of the InventoryWindow.

Quote from: Axelord1942 on Sat 03/02/2018 21:21:47
Additionally, I tried having an inventory window in the icon bar, Space Quest style, but so far all it does is show me all my items all jumbled together in the one window so I've just temporarily removed it.  Do I have to use some ActiveInventory script to get that working right?
Yes, normally you need to put a Button and change its graphic to player.ActiveInventory.Graphic in script.

Also, there is a special trick for this, which you may see in Default Template: just type in "(INVSHR)" into Button's Text property, and it will show current inventory automatically.


EDIT: wait, it looks like you are already using Default Template? If so, you should be having such button on the icon bar, unless you deleted it.

Axelord1942

Yeah, I just read about ItemHeight and ItemWidth...still at a loss though. :/ I set it up in game start as a function, right?  I'm not getting any feedback from the program (no autocomplete, etc.) so I don't think I'm doing it right.  Where do I set this up?

Thanks for the help, I appreciate it!:-D
You have been eaten by a Gru

Crimson Wizard

#3
Quote from: Axelord1942 on Sat 03/02/2018 21:43:29
Yeah, I just read about ItemHeight and ItemWidth...still at a loss though. :/ I set it up in game start as a function, right?  I'm not getting any feedback from the program (no autocomplete, etc.) so I don't think I'm doing it right.  Where do I set this up?

You may set them up in the properties window (bottom-right corner of the screen) when you select InventoryWindow control in the editor.
Note, you need to select the white rectangle frame on the Inventory GUI, not the GUI itself (grey dialog box).

Step by step, just in case:
* find gInventory under "GUIs" node in the project tree and double click to open GUI editor.
* click to select InventoryWindow (white rectangle)
* now you will see this inventory's properties in the bottom-right table.

You may also change them in script too, in game_start:
Code: ags

function game_start()
{
    invCustomInv.ItemWidth = 100;
    invCustomInv.ItemHeight = 100;
}


invCustomInv - this is how the InventoryWindow control is named in default template. If you rename it, obviously you need to use the new name.

Axelord1942

Oh my lord, I don't know how i didn't notice the parameters in the property box of the gui editor. -_-

That solves that, I guess!  Thanks for being patient, I feel pretty dumb right now! (laugh)

I'm sure I'll be back soon, I'm not very good at this yet!
You have been eaten by a Gru

SMF spam blocked by CleanTalk