views:

48

answers:

1

How can I animate UILabel to disappear like the text would be cleaned from blackboard? The animation is like hiding pieces of text rectangle with couple shape animations. Is it possible with Core Animation? I don't really want OpenGL.

A: 

You can rotate the mask property of your UILabel's layer between different states of your prerendered "clear" animation.

rpetrich
Could you please elaborate more on 'prerendered' part?
Michael
For each frame in the animation, create a mask image representing that stage of the animation. First frame would be completely opaque; last frame would be completely transparent; in between frames would have various amounts of the blackboard erased.
rpetrich
and to make actual animation in mask, have some timer and change `contents` on each tick or there is a better way?
Michael
If you want to use a UILabel, yes. You could generate the mask images at runtime, but that will could be slow
rpetrich
Also, don't change `contents`. Change `mask`.
rpetrich