kazoo Posted March 17, 2016 Share Posted March 17, 2016 Hi is it possible to update one of the properties of the arc, in the RequestAnimationFrame draw function. So I would like to update the endAngle of the arc, so that after each frame it looks like the arc is extending, getting longer. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 18, 2016 Share Posted March 18, 2016 Not possible, because in PIXI.Graphics arc is a polygon, and every time you change it, all vertices are re-calculated. You have to clear() the graphics anyway. Quote Link to comment Share on other sites More sharing options...
kazoo Posted March 18, 2016 Author Share Posted March 18, 2016 OK, understood, thanks. But here's a scenario. I have a primitive that is draggable, and after firing ondragmove, I call the renderer to redraw the stage, since I need a smooth drag. I don't use requestanimationframe draw loop btw, since I don't need it. But the question is, is redrawing the stage after each ondragmove execution too much? Also in there I wanted to put an update to the arc, but as you said it's a polygon and not possible to do that. So I would need to clear the graphics and then redraw it after each ondragmove, is that also too much of a performance impact, to clear and redraw so often, since obviously ondragmove is gonna get called a lot? Thanks. Quote Link to comment Share on other sites More sharing options...
kazoo Posted March 18, 2016 Author Share Posted March 18, 2016 I tried using clear(), but it makes a weird result. So I have a new graphics object. I create an arc out of it, then I clear that graphic object and then just call lineStyle and arc again. But instead of drawing another normal arc, I get a weird shape like broken glass all over the canvas, where the arc is supposed to be, so what is all this about? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 18, 2016 Share Posted March 18, 2016 PIXI way: redraw everything every frame. PIXI.Graphics is strange thing, try to debug it 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.