nazariof Posted February 14, 2015 Share Posted February 14, 2015 Hello Guys, Has anyone got experience on drawing a hollow circle with Pixi?, my current approach only works in the WebGL renderer which makes me think it's flawed, and i also need to fallback to the other rendered for other devices. this.mathPiDub = 2 * Math.PI;this.color = 0xFF00FFvar nuRad = 10;this.pixiCircle.beginFill(this.color, 1);this.pixiCircle.arc(0, 0, nuRad - 2, 0, this.mathPiDub, false);this.pixiCircle.arc(0, 0, nuRad, 0, this.mathPiDub, false);this.pixiCircle.endFill(); The 2D rendered gives me a full circle while the WebGL cuts the hole through. What's the best approach? Thanks!.Naz. Quote Link to comment Share on other sites More sharing options...
rich Posted February 14, 2015 Share Posted February 14, 2015 If you want a 'hollow' circle then just use the lineStroke and drawCircle. You're using beginFill, so it will always try to be filled. Quote Link to comment Share on other sites More sharing options...
nazariof Posted February 14, 2015 Author Share Posted February 14, 2015 Thanks for your reply Rich.I'm aware of there being a lineStroke but due to other reasons i need to achieve what i request which is totally possible in other Graphics APIs like in Flash and CreateJS. It's all related to the Path Winding, and the clockwise property of the arc function helps achieving this but i still can't manage to have it work properly. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/GraphicsPathWinding.html Quote Link to comment Share on other sites More sharing options...
nazariof Posted February 14, 2015 Author Share Posted February 14, 2015 Moare about Winding and Flash http://help.adobe.com/en_US/as3/dev/WS1EE3740D-F65C-43bf-9B12-74E34D7D1CBE.html Quote Link to comment Share on other sites More sharing options...
msha Posted February 14, 2015 Share Posted February 14, 2015 You can do it with a standard canvas - http://stackoverflow.com/questions/8030069/how-to-draw-segment-of-a-donut-with-html5-canvasThen generate a PIXI texture from that canvas. The last time I tried to draw a hollow circle using pixi, it was buggy on some devices - https://github.com/GoodBoyDigital/pixi.js/issues/702Maybe PIXI-s method of drawing circles and curves - triangulating them is not the optimal way and it would be better to do it with a fragment shader?... 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.