Align Inventory Items in Game [SOLVED]

Started by NiksterG, Fri 18/03/2005 01:46:45

Previous topic - Next topic

NiksterG

I made my own custom GUI for an inventory window. However, if you have one or more inventory items, they are placed randomly all over the inventory screen. How do I make it so that the items are aligned to a grid or something so that it doesn't look so weird? ???

And by the way, if this is in the manual, please tell me what to look for, because I can't find it.Ã,  :(
Check out my games! (Not all made with AGS)

Goot

Do the items look weird in the default inventory window? Make sure all your inventory sprites are the same size, and look up SetInventoryDimentions in the manual. You have to use it to set how much room an object takes up in the inventory window.
When you say "placed randomly all over the inventory screen," do you mean really randomly, like they're all over the place, or just a bit off from where they should be? I'm not really sure what else could be causing this problem. Maybe posting a screenshot of what it looks like would help someone figure it out.

Radiant

They shouldn't be placed randomly, they are in fact aligned to a grid. By which I mean that the upper left corner of each item is aligned to a grid, and there's a way to set the grid size by using SetInvDimensions (xsize, ysize).

Like Goot says, having all your items at roughly the same size helps. I believe there was a feature request to center each item in its grid square. HTH.

NiksterG

Oh... That might be why... My items are all different sizes. ::) I'll re-import them into my game and let you know if I still have problems.
Check out my games! (Not all made with AGS)

NiksterG

Ok, I tried to re-import the sprites, and they all have the same pixel width and height. My gae is high color, and the sprites were imported at high color, so no problems there. The sprites were semi-aligned when I tested, but still not like I wanted it. When I tried the SetInvDimensions command, I didn't get the sprites to show at all. (I set the command to SetInvDimensions (76, 76) because my sprites are all 76 pixels tall.) I need help, because I am horrible with scripting and inventory stuff.  :-[
Check out my games! (Not all made with AGS)

Ashen

What resolution is your game?
I think SetInvDimentions () uses 320x2*0 resolution, regardless of what it's actually set to. So, you might have to use SetInvDimentions (38,38) to get them showing properly. Also, IIRC, if the inventory items are set larger than the Inventory window on the GUI (which also uses 320x2*0 res) they don't show up.
I know what you're thinking ... Don't think that.

NiksterG

My game is resolution 640 x 480.  I reset the values to 38, like you said, and I think they work now. I can't be sure because my items are pretty sloppy, but they look pretty much lined up. Thanks a bunch! ;D
Check out my games! (Not all made with AGS)

SMF spam blocked by CleanTalk