Jump to content

Changing mouse cursor over a sprite


yahiko
 Share

Recommended Posts

I can think of a couple of ways of doing that.

 

1. You could change the CSS cursor property of the canvas when the cursor is over a sprite, then change it back to "initial" once it's not over the sprite. But I *think* browsers are spotty on supporting custom cursors and certainly spotty when updating the cursor while still over the element whose declaration you're changing.

 

2. You could check out pointer lock and draw the cursor yourself based on the raw mouse data. Not sure how Phaser handles pointer lock, though, and it's experimental.

 

3. Draw a custom cursor under the regular OS cursor in your canvas.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...