wm1sr Posted December 30, 2013 Share Posted December 30, 2013 How to set the cursor style to none, for example? When I try to set it manually before the pixi render the stage, the cursor is set to default again.So I suppose there is a way to set the cursor style using a pixi attribute/function!? Quote Link to comment Share on other sites More sharing options...
xerver Posted December 31, 2013 Share Posted December 31, 2013 The next version of pixi will use "inherit" so your css will override. Quote Link to comment Share on other sites More sharing options...
Mat Groves Posted January 4, 2014 Share Posted January 4, 2014 Hi there! There latest version of the dev branch now supports different cursor styles.Each sprite has a defaultCursor property var mySprite = PIXI.Sprite.fromImage("myPIcture.png");// to activate a custom cursor the sprite must be interactive and have button mode set to truemySprite.interactive = true;mySprite.buttonMode = true;// now you can set the cursor to be what you needmySprite.defaultCursor = "crosshair";Hope this is useful to you! Quote Link to comment Share on other sites More sharing options...
Shadowstep33 Posted March 1, 2015 Share Posted March 1, 2015 Does that cursor style property work with images? For example, is:mySprite.defaultCursor = "url(http://blah.com/jpeg.png)";correct? Quote Link to comment Share on other sites More sharing options...
Sharpleaf Posted March 9, 2015 Share Posted March 9, 2015 Does that cursor style property work with images? For example, is:mySprite.defaultCursor = "url(http://blah.com/jpeg.png)";correct?I, too, would like to know the answer to this.Is there a way to set a sprites default cursor to an image? Quote Link to comment Share on other sites More sharing options...
kaizoku Posted May 18, 2015 Share Posted May 18, 2015 Re-iterating this: Is there a standard way of setting the cursor to be your own image/sprite? We've been creating a sprite and changing its position to match the mouse pointer, but now we run into an issue where mouse events aren't triggering because the mouse is hovering on the mouse cursor sprite and not for example the button sprite you're trying to click. batman 1 Quote Link to comment Share on other sites More sharing options...
xetra11 Posted October 26, 2016 Share Posted October 26, 2016 I'm curious as well...is there really no possibility? Quote Link to comment Share on other sites More sharing options...
abetusk Posted November 11, 2016 Share Posted November 11, 2016 This is a little late but I was trying to do this with Pixi v4. I needed it for the 'stage' (now a PIXI.Container I believe). The following "works for me": ... var stage = new PIXI.Container(); ... stage.buttonMode = true; stage.interactive = true; stage.hitArea = new PIXI.Rectangle(0, 0, 800, 600); stage.defaultCursor = "url(cursor.png) 3 2, auto"; Where 'cursor.png' is the png of the cursor to use. Note that, for me, it doesn't work without the "..., auto" at the end, nor does it work if you don't specify a 'hitArea'. Hope that helps. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.