Inventory Items Overlapping

Started by Atelier, Tue 21/04/2009 18:45:55

Previous topic - Next topic

Atelier

Hullo. I would like to know how you stop items overlapping in your inventory. At the moment, when the player receives his second item, the two icons appear on top of each other and it makes it difficult to use the one on the bottom. (And it also doesn't look very nice).

Do I need to add a function giving the x and y co-ordinates?

Thank you for taking the time to read my query.

monkey0506

What you're looking for are the InvWindow.ItemWidth and InvWindow.ItemHeight properties. That will allow you to specify the size your InventoryItems should take up. If you want to have them displayed outside of a rectangular-based grid you'd have to write your own custom script to handle it.

Atelier

Thank you for the help.

Now that you have pointed me in the right direction, could I be awkward and ask how I would use those properties? Which script file do I place them in and how would I begin? Sorry for not getting it the first time; at the moment I'm using the excuse of not being too familiar with AGS.

monkey0506

If you open the GlobalScript.asc file and then go to the function game_start you could put something along the lines of:

Code: ags
invWindow.ItemWidth = 38;
invWindow.ItemHeight = 24;


Which would set each item in the InvWindow named invWindow to take up a rectangular box of 38x24 pixels. ;)

Atelier

Yay!

After seeing your example, I figured out why it wasn't suggesting invWindow in the short-cut box and therefore confusing me.
I had my inventory window called invCustomWindow, by default.

Now I have corrected it and you have made my game that little bit better.

Thank you for helping,

Francis de Mont

Trent R

You shouldn't have to script it in game_start, I believe those are listed in the properties pane when you have the inventory window selected in the GUI editor.


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

monkey0506

Touché. ;)

But anyway I am glad you got it sorted out.

SMF spam blocked by CleanTalk