Jump to content

Recommended Posts

I looked through the examples and searched online but I can't find anyone else having ever done this to use as an example;

I'm trying to hide the default computer mouse pointer and replace it with a sprite in my game that is very reactive; eg changing to different art depending on what you're mousing over or if you're giving and order or something.

Does anyone have an example of this I could look at?

Link to post
Share on other sites

I think you can deactivate the mouse crusor like this

<canvas width="800" height="600" style="display: block; cursor: none;"></canvas>

Then you can add an move callback to the game input manager like this

game.input.addMoveCallback( function(pointer, x, y) {
   // pointer is the active pointer, x and y give you the position of the pointer
   // on the canvas so here you can position you custom cursor sprite
});

Didn't test it but I think it should work

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.

Guest
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.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...