Change cursor center in runtime [Solved]

Started by rmonic79, Fri 08/04/2016 09:24:48

Previous topic - Next topic

rmonic79

Hi guys we need some help :)
we are making an inventory window DOT style with the cursor get the image of the inventory items but returns normal when over a gui and viceversa. The problem is that we need to restore the center of the normal cursor and get and restore the center of the inventory image in runtime and i didn't find the right function to do it, any help?

Snarky

Are you trying to do this by just changing the cursor graphic? Instead, you should change between the inventory cursor and the normal cursor, with the center for each set in the editor.

Crimson Wizard

What Snarky said is true: you should probably use the "Use" cursor and switch between cursor modes dynamically as the mouse moves into and out of gui.
It will be much easier for you.

To answer your question directly, though -
There is a function Mouse.ChangeModeHotspot which changes the cursor hotspot.
There are no means for getting current hotspot; the only way I can think of is to write down an array of cursor hotspot coordinates, corresponding to every possible cursor image, and use it when restoring a cursor.

rmonic79

Thanks meantime i found changemodehotspot too and it works fine ;)

SMF spam blocked by CleanTalk