[SOLVED] InvItem ignores 0,0 as cursor hotspot

Started by Vaunted, Wed 24/04/2013 15:00:42

Previous topic - Next topic

Vaunted

Sorry if this has been answered or covered elsewhere, I searched around for a while and couldn't find anything precisely like this.

I'm finding that if I leave an inventory item's cursor hotspot set to the default of 0,0, AGS ignores that setting and places the cursor hotspot in the middle of the item's cursor image. If I manually set the cursor hotspot to 1,1 in the inventory item's settings, however, it works as expected. I realize I could just go through my inventory items and manually set all the cursor hotspots to 1,1 rather than 0,0 as a workaround, but I'm curious if this is just a quirk of the engine or something I've caused somehow. All the other cursors -- ie., the ones not derived from an invitem -- work just fine with 0,0 for the hotspot.

The only other relevant bit of info I can think of is that I'm using a standardized item cursor image that's the same for every item, because I'm highlighting the currently selected inventory item in the inventory window rather than using the cursor to indicate which item is selected. The code for that isn't actually implemented yet, though, so I can't see how it'd have any effect.

I've read in older posts that AGS will ignore the cursor hotspot if it's set for an x,y that's located outside of the image (like -10, 2), but I don't see why 0,0 would be acceptable for non-InvItem cursors but not for InvItems, unless they're just arbitrarily different and/or handle the exception differently.

Khris

I guess this behavior was included because centering the hotspot by default will work for most people.

There is an easy way to work around this though, based on how you said you want your interface to work: in General Settings / Inventory, turn off the last option.

(This also makes it unnecessary to set all inv item cursor images to the same sprite manually.)

Vaunted

Terrific, thanks Khris! That's a huge help.

SMF spam blocked by CleanTalk