stamas47 Posted March 29, 2016 Share Posted March 29, 2016 I have a sprite with .useHandCursor = true and events.onInputOver.add(this.OnMouseOver, this); BUT: If the mouse is already over the sprite I have to move it out and back again for the event to trigger. Now this is not a problem becouse I can rectangle.contain check the mouse cursors position when my button shows but that is only a graphical change. I need to also change the cursor to pointer. I also got this to work but I have to move the cursor (atleast 1 pixel) for the cursor to change. Is this a browser/html thing? If not how could I instantly change the cursor? Link to comment Share on other sites More sharing options...
fillmoreb Posted March 29, 2016 Share Posted March 29, 2016 Check to see if the mouse is over the sprite and if it is, you can manually force the hand cursor by doing something like this: this.game.canvas.style.cursor = "pointer"; sprite._setHandCursor = true; I'm not totally sure on the second line, but you might need to include it so that the sprite knows it's using pointer and needs to turn it off on mouse out. Link to comment Share on other sites More sharing options...
stamas47 Posted March 30, 2016 Author Share Posted March 30, 2016 Thank you for the response but there is no such command as setHandCursor. (And I am using a Graphic as a button background withing a Group anyways) And yeah, I am already using the first line which only changes the cursor to pointer if i move the mouse atleast 1 pixel. Link to comment Share on other sites More sharing options...
Recommended Posts