Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: cece0808 on Thu 12/01/2006 15:49:32

Title: ItemHeight/width?!
Post by: cece0808 on Thu 12/01/2006 15:49:32
How can I change the sizes of slots for the inventory items?

Example:

invMain.ItemWidth = 50;
invMain.ItemHeight = 30

I found that from the manual, but I was unable to find anything like that from any script files. So where can I change the slot sizes? ???

thx!
Title: Re: ItemHeight/width?!
Post by: ManicMatt on Thu 12/01/2006 16:18:17
Ooh me! Me! I know that one!

I had the same problem, until someone here told me I could double left click inside the inventory GUI box and a new window would appear, and in that window you can change the dimensions!
Title: Re: ItemHeight/width?!
Post by: cece0808 on Thu 12/01/2006 16:25:59
Yeah thx for that, but there must be a script somewhere which to edit. There are numerous other option how to manage inventory, but they all require to find that script... :P Now I need to know how to manage how many items there are per row.  ???
Title: Re: ItemHeight/width?!
Post by: Khris on Fri 13/01/2006 08:04:48
That isn't anywhere in the default script.
Code like this goes into the game_start-function of the global script.

To change the number of items per row, resize the inventory window to desired_items_per_row*invMain.ItemWidth
(I assume that you're using a custom inventory GUI)
Title: Items per inventory row problem!
Post by: cece0808 on Sun 15/01/2006 12:10:00
I've asked this before, but didn't receive any that good answer. So, how do you tell the game how many items per inventory row are displayed? I can't find it anywhere. From the manual, I found some instructions and scripts, but I cannot find the place in global script where to place them.

So, can someone give me step-to-step instructions HOW to change, how many items inventory displays on one row?

thx very much!
Title: Re: Items per inventory row problem!
Post by: Ashen on Sun 15/01/2006 12:18:32
Topics merged.

I think the answer khrismuc gave you is fairly clear, but to clarify:
You can't exactly tell AGS how many items to have per row, it's calculated internally - there are as many items per row as will fit. So, if your items are 30 pixels wide and the window is 150, there'll be 5. If it's 140, there'll be 4 and 20 pixels of space. (The same is true of how many rows there are - as many as can fit).
To change the number of items per row, change the size of the window (or the items, but that's a bit extreme).