Reputation: 4062
I would like to implement a new CATransition.
For example, let's say I would like to do this effect: a n by m array of two sided layers that have a portion of the source image on one side, and the a portion of the destination image on the other side. Each layer would rotate around its x axis by 180 degrees to reveal the other side. Can such a logic (animated CALayers) be used for a CATransition ?
Upvotes: 0
Views: 208
Reputation: 131503
I have written a transition effect like you describe, but it was not a CATransition. Instead, I created my own method to handle view transitions, and invoke that.
My transition cut the two views into vertical slices, and then did an animation where I start rotating the slices around their Y axes, starting with the left-most slice and working to the right, which creates a cool-looking cascade effect. It took quite a bit of work with CAAnimationGroup obbjects, plus using beginTime for each strip's animation to stagger it's beginning. That one transition animation took about 5 pages of code.
Upvotes: 0
Reputation: 1670
I don't think you can do this. The only way to customize CATransition
beyond the built-in types and subtypes, is by using a CIFilter
(from iOS 5.0 or OSX 10.5). And the only way to create a custom CIFilter
beyond chaining and configuring built-in filters is, according to the doc :
You can subclass CIFilter in order to create:
- A filter by chaining together two or more built-in Core Image filters (iOS and OS X)
- A custom filter that uses an image processing kernel that you write (OS X only)
So doing this based on CALayer animations is not possible. On OSX this should be managable with some math work, but not directly using CALayers animations. In iOS this is simply not possible.
Instead of doing a CATransition you could achieve the same effect by using layers directly, but obviously it would not integrate as easily in your UI code.
Upvotes: 1