Sign in to follow this  

Change cursor view in PIXI.js

Recommended Posts

Hi everyone, 

I checked many articles about this topic. All what I tried didn`t work for me. But unfortunately there is no clear vision what are the steps to make your custom designed (from your png or cur file) cursor view.  Just simply change from default one (white arrow) to my own. The questions are the follows:

  1. What kind of variables I should declare?
  2. Where in the code I should declare them (like global, or in setup function, or update function)?
  • Examples: 
  1. Complete code to use cursor defined in CSS file? ( example of css, and js file). Nothing else, just using cursor style defined in CSS.
  2. Complete code of defining your own cursor in js file (pixi application). Nothing else, just using my own cursor style (png, cur) in PIXI application.
  3. Any other solution. 

I think replies on these questions will shed the light on this mysterious topic.

What I checked:

Thank you in advance, 

Share this post

Link to post
Share on other sites

One way to achieve that is to have a container inside your container that is being rendered and use following:

container.cursor = "url('path to image'),auto";

Another way is to just set it with css directly to parent of canvas.

There's also settings in interactionmanager for default styles.

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.