I need to draw donut with certain thickness where inner circle would be transparent.
Something like this:
I am using latest Starling from git.
I would not use the Canvas. It is easy to do as a Mesh as a donut is essentially a rectangle curved around and joined at the ends. That means you can use a triangle strip, plotting the points using trigonometry. Use enough triangles and it becomes indistinguishable from a circle/donut.
If it is to be drawn to a RenderTexture than another way that might be even easier is: draw() a circle, then draw() another smaller one with BlendMode.ERASE for the inner transparent hole.
Thanks for the reply.
It works great. But just to make a note that blend mode needs to be set on the canvas itself because there is no blend mode parameter in draw function of RenderTexture class.
I was a little confused at first because I was searching for blend mode parameter in draw function.
You must log in to post.