Kubenexion Posted May 29, 2016 Share Posted May 29, 2016 Hi everyone ! I'm trying to use Graphics arc to make an animated timer but I have an issue, when I want to refresh my shape in the render loop: the graphic disappear... Here is a Codepen with the issue : http://codepen.io/Kubenexion/pen/LZYOOR?editors=0010 Did I do something wrong ? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 29, 2016 Share Posted May 29, 2016 No "endFill". Is that ok? Quote Link to comment Share on other sites More sharing options...
Kubenexion Posted May 29, 2016 Author Share Posted May 29, 2016 I try with and without endFill, it changes nothing (but it's certainly better to add endFill) Quote Link to comment Share on other sites More sharing options...
ecv Posted May 29, 2016 Share Posted May 29, 2016 (edited) Adding a line style solved it. Don't ask me why [...] graphics.clear(); graphics.lineStyle(1, color); graphics.beginFill(color, 1); [...] Edit: Actually lineStyle(); alone seems to suffice Edited May 29, 2016 by ecv oh! Kubenexion 1 Quote Link to comment Share on other sites More sharing options...
Kubenexion Posted May 29, 2016 Author Share Posted May 29, 2016 Yep, it works. Thanks you ecv 1 Quote Link to comment Share on other sites More sharing options...
kazoo Posted June 3, 2016 Share Posted June 3, 2016 Hey, nice work. I have an addition to make to this, or rather a question. If I take your exact same code, how would i just instead of the color add a texture to it. Specifically a texture that was made out of a tiling sprite, like a hatch pattern. I can add a codepen but it is basically the same as OP's I just need a texture on it. I already tried and made a tiling sprite, 500x500 px, and then I applied it as a mask to the arc, but nothing shows up. Any examples on this? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 3, 2016 Share Posted June 3, 2016 @kazoo Masking doesnt work for strokes, you need to fill it. There's second solution - may be you need a rope: http://pixijs.github.io/examples/index.html?s=basics&f=textured-mesh.js&title=Textured%20Mesh&v= Quote Link to comment Share on other sites More sharing options...
kazoo Posted June 3, 2016 Share Posted June 3, 2016 As always, thanks for the speedy reply Ivan. Yeah I figured, so I went with filling the arc. It works thanks. 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.