Inventory items are overlapping [solved]

Started by HandsFree, Wed 20/04/2011 14:12:04

Previous topic - Next topic

HandsFree

Hi all, my first post here.
I've recently downloaded AGS 3.2.1. to have a look how everything works.

Because I'm completely incapable of drawing anything recognizable, and to have a quick start, I loaded the RON template and a few RON backgrounds and sprites.
I'm really enjoying learning this and the tutorials are helpful, but now I'm stuck with the following:

When there are multiple inventory items in the inventory window, they are overlapping.
It looks like this

And when they don't overlap, there still is no space between them (see the coins and the rope).
Is there a way to space the items so they're a bit apart, regardless of their size?
Or should inventory items have a specific size? Or should height and width be equal?
I tried resizing, but it doesn't seem to help much.

Thanks

m0ds

Hello! I think it's the "ItemWidth" option you need, this is from the help file:

Quote
int InvWindow.ItemWidth;

Gets/sets the width of the items in the inventory window. You should generally set this up in game_start to the width of your largest inventory item. The default is 40.
Example:

invMain.ItemWidth = 50;
invMain.ItemHeight = 30;

sets the invMain inventory window to use item cells 50x30 large.

Khris

Exactly, you can also set this in the editor by opening the inventory GUI and selecting the invWindow, then changing the values in the property list.

You should decide on a fixed size and draw all inventory items according to that. If you want padding, draw the sprites a bit smaller than the item dimensions.
(In other words, AGS ignores the sprite size when drawing the inv items, it'll use a grid with one cell being ItemWidth x ItemHeight).

HandsFree

OK, thanks. I didn't realise you can select the inventory window from the gui.
In the RON template the scripting bit turns out to be:
  gInventory_invWindow.ItemWidth = 50;
  gInventory_invWindow.ItemHeight = 30;

I have to play around a bit more with the values though.

thanks

SMF spam blocked by CleanTalk