I am trying to make a timer and I want a circle that is always shown. It starts out green. As time progress’ a growing red pie slice begins to occupy more and more of the circle until the entire circle is red. Does that make sense?
The restrictions are that I can’t use sprite, so it would have to be done with UIComponent or some other format. Additionally, I can’t use degrafa. The SDK I am using does not support these methods.
UPDATE: Sweet! Thanks for the code. It works like a champ. My only hold back is that the SDK I am using does not support rotation, but I think I can make this all work. Thank you so much!! For others that can’t use sprite, just substitute UIComponent where sprite is.
FOLLOW-UP: I am pretty sure rotate is the only way, but is it possible to make it start at the 12 o’clock position without rotate?
Use another Shape as a mask to perform the reveal.
Code sample for expanding pie wedge
Instantiate your Sprite:
Draw wedge code:
Then us this in your animate code: