Jump to content

Pixi + Custom Cursor + Disappearing Cursors


kaan
 Share

Recommended Posts

Hi

I'm wondering whether there is an intended way of replacing the cursor with an image using Pixi

Some ideas I have:

1) Would be using CSS to replace the cursor, I also see discussions related to a .defaultCursor property from 2013 that changes the cursor for specific sprites, even without any Pixi features that I don't know of, cursor could be changed with CSS on hover in/out etc.

2) Would be hiding the cursor and drawing it manually

One issue I'm facing on OSX, without any cursor modifications is a disappearing cursor, when I move around with WASD, the cursor disappears, what's bad is that this is not specific to Pixi or Gaming or the Browser, it happens everywhere, probably a system thing, so (2) seems like a good option - yet - if frames drop below 60 fps, it might give cancer to the player (Just came across this: http://stackoverflow.com/a/3899005/914546 - so (1) + (2) might be possible too)

Link to comment
Share on other sites

  • 2 weeks later...
On 6/8/2016 at 8:59 PM, ivan.popelyshev said:

//this is by default - take it from parent
//you can change that.
renderer.plugins.interaction.defaultCursorStyle = 'inherit';

I dont know about pixi v3, but in v4 we definitely have it :)

Thanks for the suggestion

One of your previous suggestions was to read the pixi code, indeed it's very readable

sprite.interactive=true;
sprite.buttonMode=true;
sprite.defaultCursor="help";

Started using this right now, works great

As for the disappearing cursors, I guess the best solution is to ignore the issue, I also switched the game to mouse movements instead of WASD (on OSX browsers, it probably should be all mouse or all keyboard, because the combination is extremely annoying, controller-wise speaking)

Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...