views:

144

answers:

1

i have to animate text around a circle. The text will also scale up/down. Whats the best approach to accomplish this? (i am using Quartz 2D)

My approach is:
-- Calculate point using sin and cos methods.
-- Move Pen there and draw text with alpha and size.
-- Clear the screen -- Calculate next point using sin and cos methods.
-- Move pen there and draw text with alpha and size.
-- clear the screen
so on...

any better way?

A: 

If you're targeting iPhone OS ≥3.2, use CATextLayer.

Otherwise, you could create a UILabel and modify its transformation value, or control a CALayer directly.

If you're constrained to Core Graphics the method your described is the best already, but CG is not an animation framework. You should use Core Animations for UI animations.

KennyTM
Can i apply Core Animation on Quartz 2d?
coure06
@coure06: Yes, but you have to draw on a CALayer.
KennyTM