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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.