mcolman Posted April 7, 2016 Share Posted April 7, 2016 Hi, just trying to work out the internals of Pixi Graphics. It appears to me that the `arc` method plots points and draws to a canvas context, rather than just using `context.arc`. Is this correct? How come? I ask because I can see the curve is not perfect. Thanks! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 7, 2016 Share Posted April 7, 2016 That's because its intended to work both for canvas and webgl. If you want perfect curves - create a canvas element, use context api and then wrap it into "new BaseTexture(myCanvas)", or "BaseTexture.fromCanvas(myCanvas)" or "Texture.fromCanvas(myCanvas)", dont forget to update base texture every time you change something on canvas. mcolman 1 Quote Link to comment Share on other sites More sharing options...
mcolman Posted April 7, 2016 Author Share Posted April 7, 2016 k thanks! Quote Link to comment Share on other sites More sharing options...
shabeerahmedshah Posted April 10, 2016 Share Posted April 10, 2016 Could anyone help me in making the graphics event-transparent so that I can get the click event on the sprite which is underneath the graphics? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 10, 2016 Share Posted April 10, 2016 4 hours ago, shabeerahmedshah said: Could anyone help me in making the graphics event-transparent so that I can get the click event on the sprite which is underneath the graphics? Its easy. Just override Graphics.containsPoint : https://github.com/pixijs/pixi.js/blob/master/src/core/graphics/Graphics.js#L921 , make it so it stores number of shape which actually contains that point in some variable, like "this._interactedShape" Quote Link to comment Share on other sites More sharing options...
shabeerahmedshah Posted April 11, 2016 Share Posted April 11, 2016 Thanks for replying ivan, but I am a newbie to pixi so didn't fully get what you just suggested. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 11, 2016 Share Posted April 11, 2016 4 hours ago, shabeerahmedshah said: Thanks for replying ivan, but I am a newbie to pixi so didn't fully get what you just suggested. Copy that function and store "i" somewhere to use it later This function is called from InteractionManager when it needs to know whether the object was hit 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.