How to replace cursor(Web)

Replacing cursor with custom image when playing game in cocos creator?(web desktop)


Built In Events

  1. Use mouseenter Event to add an image that you want to replace the mouse cursor with.
  2. To Hide the mouse cursor use this in the main canvas script.

document.getElementById(“Cocos2dGameContainer”).style.cursor = “none”;

  1. Then use mousemove Event to track where the user is moving the cursor and keep updating each time he moves it.

Thanks for the solution

Thanks,ill try

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.