Problem with inventory and images

Started by The Creator, Wed 11/01/2012 20:00:40

Previous topic - Next topic

The Creator

Hello, i'm using the default basic project that's featured in the tutorial and i am having some trouble with the inventory.

I've created a new key object, it's working fine but when i try to select it in the inventory, i can only do it by clicking in the upper-left quadrant, if i try cliking in the middle of the pic, it does not become selected =x.

Also, for some the reason, all of the buttons are black. They work, but they are all black. Is this because the default game project doesn't have any inventory buttons or i'm missing some files?

I've uploaded a screenshot of the mouse over the key, if i click right there nothing happens.




Thanks!

steptoe

#1
You can set the 'hotspot' for all inventory items.

Simply click the inv object from the inv tree and set the hotspot where you want it to be active. IE Middle of Key.

Not sure about black button areas.

The game default buttons are grey (image 0).

Did you import button that have black in? Did you select any transparency?
It's not over until the fat lady sings..

The Creator

I tried doing that, but it just changes de hotspot for the mouse cursor when you've already selected the item.

steptoe

#3
Provided you have set the inv hotspot, as well as eye and hand cursors it should not be a problem.

Check inv itemheight and Itemwidth in Inv window.  if area bigger than inv item it may cause problem?

Anyhow, you say you select the item from inv and the mouse cursor image changes, to what. Is this correct?

Also, try changing button images to 0 and see what happens (button should appear grey)
It's not over until the fat lady sings..

NickyNyce

#4
Make sure all your inventory items are the same size. Once you do that, enter the Itemheight and Itemwidth in the inventoryWindow properties pane so the hot spot for all of the items will be the same.

Click on the inventory buttons and you can change the graphic to whatever you want (Image). Look at the default sprites, just type the default sprite numbers into the properties window of each button ...put these numbers where it says image.

The Creator

#5
I tried changing the Itemheight and ItemWidth and it worked, i can now select it from any point of the image.

Also, when i see the window from the editor, i can see the buttons correctly, but when i run it, they still became all black =x

EDIT: i've also noticed that the white stripe that separates the Item area from the buttons area, it's also not showing.

steptoe

#6
I'm glad the inventory items are now solved.

Not sure about the button problem at the moment. Are they the game default buttons? Have you changed the games colour depth? Ie 16 to 32 etc after importing your images?

The white box outline around the inventory window is a guide and does not show in game.

It's not over until the fat lady sings..

The Creator

No, i set it to 32 since the beginning.

I tried changing the spirte for one button, and it did show up, but it's much smaller than the other ones but only in looks, you can still click the same area as the other one. It's weird because i checked the width and the length of the previous image, and made it the exact same size =X.

steptoe

#8
Make a button the default image 0 and run the game and see if it shows.

when you import any sprite make sure you get correct transparency correct ie top right, top left, bottom right, leave as is etc etc

EG if you have an all black button and you select say top right transparent then your button will be all transparent!
It's not over until the fat lady sings..

Khris

Quote from: The Creator on Wed 11/01/2012 20:56:02
No, i set it to 32 since the beginning.

That's the problem. A "quick" way to rectify this is to open the Sprite manager, right-click the button sprite, select "Copy sprite to clipboard", the right-click it again, select "Replace sprite from clipboard..." and in there, select "Leave as-is", then "Import whole image".
This causes the button graphic to get re-imported @ 32bit color-depth and it should show up fine afterwards.
Repeat for every black button.

Regarding button sizes, from your screenshot I take it you changed the game resolution to 640 and when AGS asked you about resizing the GUIs, you chose yes. If you do that, AGS goes through all GUI sprites and upscales them arbitrarily using nearest neighbor, in your case to exactly twice the size. The existing buttons therefore appear lowres but are actually highres buttons consisting entirely of 2x2 "pixels".

If you plan on making an actual game, I'd recommend you to immediately decide on a resolution you want to use before doing anything else. If you don't want to re-draw all buttons, restart and this time don't let AGS resize the GUIs. You can still enlarge the InventoryGUI and its ItemWindow but you'll have neat smaller non-pixeled buttons that are actually in accordance with the chosen resolution.

The Creator

Ok, for now i'm gonna use new images since i'm just making a test, but i'll have it in mind for the next step.

Thanks

SMF spam blocked by CleanTalk