Mouse.ChangeModeGraphic() with DynamicSprite

Started by Windenwart, Fri 13/04/2007 09:53:24

Previous topic - Next topic

Windenwart

Hi,

when I use Mouse.Mode = 4 (Use Inventory) then I have two options:

(  ) Don't use inventory graphics as cursor -> I see the "player.ActiveInventory.Graphic" as cursor
(X) Don't use inventory graphics as cursor -> I see the "Mouse.Mode = 4 graphic" as cursor

In my game I want to use (for better "feeling") both graphics in combination:



My plan:

I create a new (dynamic) sprite with "Mouse.Mode = 4 graphic" and the "player.ActiveInventory.Graphic" and change the "Mouse.Mode = 4 graphic" to this new sprite. Is this possible? I only see the Mouse.ChangeModeGraphic(CursorMode, int slot) function with a slot sprite....

Khris

Quote from: manualreadonly int DynamicSprite.Graphic;

Gets the sprite slot number in which this dynamic sprite is stored. This value can then be passed to other functions and properties, such as Button.NormalGraphic.

Ashen

Yes, please read the manual in future. As Khris showed, this is clearly answered there. It can be difficult to know where to look sometimes, but the anser is often in the question - in this case you where using a DynamicSprite, so the DynaicSprite functions and properties would be a good starting point.

However, for what you want the easier solution may be to use the 'Use sprite slot:' option in the 'Hotspot marker settings' box at the bottom of the Inventory Items window. Set that to your pointer graphic, and AGS automatically combines the two graphics for the cursor. I think it centres the pointer sprite on the items Cursor hotspot, so you might need to experiment a little with placing that for it to look right.
I know what you're thinking ... Don't think that.

Windenwart

Quote from: Ashen on Fri 13/04/2007 10:23:15
However, for what you want the easier solution may be to use the 'Use sprite slot:' option in the 'Hotspot marker settings' box at the bottom of the Inventory Items window. Set that to your pointer graphic, and AGS automatically combines the two graphics for the cursor. I think it centres the pointer sprite on the items Cursor hotspot, so you might need to experiment a little with placing that for it to look right.
That's it! Very easy way. Thank you.

Windenwart

How I can set the item hotspot pixel to (0,0)? When I click on this point, the hotspot jumps to the middle of the image...

Scorpiorus

Yep it does. Just set it as close as possible; one pixel aside (diagonally) shouldn't make a big difference really.

SMF spam blocked by CleanTalk