开发者

Quartz 2D animating text?

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 an开发者_如何学编程d size.

-- clear the screen

so on...

any better way?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜