How can I make a pie timer? I need to be able to draw a circular arc with dynamically changing angles.

BTW…

As an easy workaround for aliasing of vector graphics on corona, I used to create an object 3-4 times larger and scale it down.

It worked quite ok for me back when I needed it for some testing.

I could be wrong, but I was under the impression that anti-aliasing was removed a year or two ago and has not come back since. There is the option for changing the OpenGL Rendering mode to “linear” or “nearest neighbor,” but that only impacts images loaded from file, not vector objects. Here’s the request for that feature, and notes from David Rangel on its implementation (the request is marked as “completed”): http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/3574881-nearest-neighbor-opengl-rendering-mode 

I notice that the chart ‘bleeds out’ at the bottom on the iPad (iOS7).

Do you know why ? See the screenshot.

This is likely related to the dynamic masking method I employ, which still has a few kinks that present themselves in certain situations. Try reducing the radius a bit and see if you still get the same issue at all radius values. This didn’t happen for me on my iPad Air back when I created the module, but perhaps you’re on an iPad 2? I don’t have one of those, so I’m unable to test directly.

I hope to nail down a solid fix that will “always work” for generating dynamic masks. Once I do, I’ll be sure to update the module. Sorry it wasn’t as smooth as it should be for you!

Hi,

Ya. I am on iPad mini with the retina display (either iPad2 or 3).

I tried to adjust the values, but they are still the same. Pls see the screenshots.

Thanks

for what it’s worth, and with no intent to diminish the cleverness of Jason’s existing solution, you can get around all this mucking about with masks by just creating a bunch of “wedges” (ok, technically isosceles trapezoids) between the inner and outer radii along the chords at whatever degree of segmenting you want to chop up the circle.  (or even just rectangles - slightly different look, but one you’ve seen before)

if you segment up the circle fine enough, the discreteness is indistinguishable from continuous.  see attached top left-most instance where finely segmented, compare with 3rd on top row where more coarsely segmented.  (others are just additional instances of same class with varying segmentation, radii, thickness, etc)

if as you’re creating each “tick mark” you give it a ratio property (fe, i’m number 7 of 100, or 0.07) then it’s really easy to toggle on/off just the ones you need for an indicated degree of progress.  (also easy to do a “trail” where the tail follows along at “progress-0.25” or such, instead of staying stuck at 0, like if used as an indeterminate “busy” indicator rather than strict linear progress)

fwiw, hth

@horacebury

Thanks for your elegant solution. I found a minor issue with it: Sometimes the ring doesn’t go all the way to the end (i = 360).

Manually calling render() one last time in the onComplete-Function solves this problem.