codecowboy
codecowboy

Reputation: 10124

Animating text on iOS

I'm writing an iOS app which needs to generate and animate individual text characters dynamically. The actual text being displayed will be dynamic and I want to use layers and masks to animate individual characters. Does anyone have any experience of what is the best and/or easiest way to do this? I've been looking at CoreGraphics and CATextLayer.

Is CATextLayer actually just making CG calls under the hood?

Upvotes: 1

Views: 1475

Answers (2)

hotpaw2
hotpaw2

Reputation: 70743

One simple way to do this is by calling drawRect (via setNeedsDisplay) off of a timer (or CADisplayLink). Just update the xy location (rotation, size, etc.) of each character each animation frame and redraw the view containing the characters.

Upvotes: 1

tadejsv
tadejsv

Reputation: 2092

Well, the only way to do this is with CAAnimation. You'll have to animate each character individually.

I don't think that CALayer is making calls to CG-stuff, because it's a pretty full calss on it's own and doesn't need other frameworks. The only CG-stuff that is using is CGFont.

Upvotes: 1

Related Questions