Inventory GUI with seperat inventory window and slide function

Started by Fuchs, Wed 15/02/2012 21:02:37

Previous topic - Next topic

Fuchs

Hello everyone!
I started to work on my game and i am doing pretty fine so far!
But now I run into some minor problems concerning custom GUIS (the Manual is not detailed enough and every other tutorial just gives broken links so I need to ask now).

First of all I would like to have an inventory in which I don’t have one big “Inventory Window” which keeps every found object. I would rather like an Inventor in which every single object got a separate slot, much like in this game here:
http://www.arcor.de/iimages/30/art_440x330_V1qFZq+vZILAqlaDimGq8meCkdOK.jpg
If I simply create several “Inventory Windows” in the GUI function then each windows holds the item I picked up. Say I made 6 slots, then I see the object 6 times (once in every window) But I want the object to be only in the first inventory window. Is there maybe a simple function I haven’t seen so far? (my AGS Version is really new)

Further than that I would like to have an Inventory that the player can open by scrolling with the cursor over a certain spot on the screen. Then I want the Inventory to scroll up. This way the Player would not have to go through the Status bar each time he/she wants to peak onto the found treasures. It would be great if someone could help me with that!
So thank you guys in advance! I hope I to find help soon, since I am so keen on going on. Creating a game in AGS is so much fun! (even though I am just a beginner jet)

Fuchs

Ali

You don't need to make several inventory windows to create slots. Just create one large inventory window and AGS will automatically arrange items in slots within that area. I guess your inventory windows are so small that they are only able to show one slot each, which is always the most recent object.

You can customise how many slots appear in a row and what size you want them by setting these values:
InvWindow.ItemWidth
InvWindow.ItemHeight
InvWindow.ItemsPerRow

However the slots will not be visible until there is an inventory item in them. All you need to do is create a background graphic showing slots at the appropriate intervals and put it on the GUI behind the inventory. That would give the effect from the screenshot you posted. It's doesn't allow you to rearrange objects like an RPG, but it doesn't sound like that's your intention.

The 'Mouse YPos' visibility setting might have the effect you want, of switching the GUI on when the mouse is at the top of the screen. Alternately, you can switch the inventory on and off using this command:

InvWindow.Visible

And you could put a condition in repeatedly_execute which checks whether the mouse is over a certain spot.

Good luck!


Fuchs

Quote from: Ali on Wed 15/02/2012 23:22:25
You can customise how many slots appear in a row and what size you want them by setting these values:
InvWindow.ItemWidth
InvWindow.ItemHeight
InvWindow.ItemsPerRow

The 'Mouse YPos' visibility setting might have the effect you want, of switching the GUI on when the mouse is at the top of the screen. Alternately, you can switch the inventory on and off using this command:

InvWindow.Visible


Hy Ali! Thanks for your reply! :-)
Where can i find the "ItemsPerRow" function? Its not like under the "Item Size" function and i cant see it anywhere else in the optionwindow for Inventory windows.
And the YPos visibly setting is kind of ...not working. I can click on visibly: when cursori is on top of screen, that has the effect i am looking for. But the "when cursor is on top of screen" is a set option, and its the oly one in the property window, i cant change it to "when cursor is on bottom of screen" for example.

Ali

Those are variables you have to set in the script, for instance within the game_start function.

If you're not familiar with setting values like that, then creating a custom GUI might be a little tricky. Similarly, if YPos is too limited you will need to script the GUI switching on and off using conditions.

There are folk around here who can probably give you an example off the top of their heads, but I'm afraid I'm not one of them. All I can suggest is start with something simpler than a custom inventory, and experiment with scripting a bit.

Also, you might have more luck posting in the beginners' forum for future problems like this.

SMF spam blocked by CleanTalk