Sign in to follow this  

Changing mouse cursor over a sprite

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.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.