Difference between revisions of "CATransition"

From iPhone Development Wiki
Jump to: navigation, search
m (Undo revision 562 by KennyTM~ (Talk))
(availability & subtypes. Added simple info about the 'rotate' transition.)
Line 15: Line 15:
 
</gallery>
 
</gallery>
  
== filter ==
+
== subtype and filter ==
 
{{main|CAFilter}}
 
{{main|CAFilter}}
 +
Many transitions have are further divided into several discrete subtypes. They often control the movement direction of the animation.
 +
 
Some transitions accept addition arguments through the filter property, for example, you can set the location of suckEffect using
 
Some transitions accept addition arguments through the filter property, for example, you can set the location of suckEffect using
 
<source lang="objc">
 
<source lang="objc">
Line 29: Line 31:
 
|-
 
|-
 
! Transition
 
! Transition
 +
! Subtypes
 
! Accepted parameters
 
! Accepted parameters
 
|-
 
|-
| cube
+
| moveIn<br />push<br />reveal
 +
| '''''fromLeft''''', fromRight, fromBottom, fromTop
 +
| -
 +
|-
 +
| pageCurl, pageUnCurl
 +
| fromLeft, fromRight, fromTop, '''''fromBottom'''''
 +
| <tt>float inputColor[];</tt>
 +
|-
 +
| cube<br />alignedCube
 +
| '''''fromLeft''''', fromRight, fromTop, fromBottom
 
| <tt>float inputAmount;</tt> (perspective)
 
| <tt>float inputAmount;</tt> (perspective)
 
|-
 
|-
| oglFlip
+
| flip<br />alignedFlip<br />oglFlip
 +
| '''''fromLeft''''', fromRight, fromTop, fromBottom
 
| <tt>float inputAmount;</tt>
 
| <tt>float inputAmount;</tt>
 
|-
 
|-
 
| cameraIris
 
| cameraIris
 +
| -
 
| <tt>CGPoint inputPosition;</tt>
 
| <tt>CGPoint inputPosition;</tt>
 +
|-
 +
| rippleEffect
 +
| -
 +
| -
 +
|-
 +
| rotate
 +
| 90cw, 90ccw, 180cw, 180ccw
 +
| -
 
|-
 
|-
 
| suckEffect
 
| suckEffect
 +
| -
 
| <tt>CGPoint inputPosition;</tt>
 
| <tt>CGPoint inputPosition;</tt>
 +
|}
 +
 +
== Availability ==
 +
<!-- 2.x: Check function _CARenderTransitionLookup -->
 +
<!-- 3.0+: Check function __ZN2CA6Render10Transition17lookup_transitionEj -->
 +
 +
The following shows the availability of different CATransitions starting from 2.0
 +
{| class="wikitable"
 +
|-
 +
! CATransition !! Availability
 +
|-
 +
| fade<br />moveIn<br />push<br />reveal || (Public API) 2.0–
 +
|-
 +
| flip<br />alignedFlip<br />oglFlip || 2.0–
 +
|-
 +
| cube<br />alignedCube || 2.0–
 +
|-
 +
| pageCurl<br />pageUnCurl || 2.0–
 +
|-
 +
| rippleEffect || 2.0–
 +
|-
 +
| suckEffect || 2.0–
 +
|-
 +
| cameraIris<br />cameraIrisHollowOpen<br />cameraIrisHollowClose || 2.0–
 +
|-
 +
| rotate || 4.0–
 +
|-
 +
| spewEffect<br />genieEffect<br />unGenieEffect<br />twist<br />swirl<br />charminUltra<br />reflection<br /> zoomyIn<br />zoomyOut <br />mapCurl<br />mapUnCurl<br />oglApplicationSuspend<br />cameraIrisHollow
 +
| 2.0–2.2
 
|-
 
|-
| pageCurl, pageUnCurl
 
| <tt>float inputColor[];</tt>
 
 
|}
 
|}
  

Revision as of 07:36, 18 March 2011

CATransition is an Objective-C wrapper for creating view transitions. As of 3.1.2, there are 11 types of transitions. 4 of them are SDK-compatible, but are the most boring ones. The following shows all 11 types of transition from picture "A" to "B" at 40%. The subtypes, if any, is "fromLeft".

subtype and filter

Many transitions have are further divided into several discrete subtypes. They often control the movement direction of the animation.

Some transitions accept addition arguments through the filter property, for example, you can set the location of suckEffect using

...
CAFilter* filter = [CAFilter filterWithName:@"suckEffect"];
[filter setValue:[NSValue valueWithCGPoint:CGPointMake(160, 240)] forKey:@"inputPosition"];
transition.filter = filter;
...
Transition Subtypes Accepted parameters
moveIn
push
reveal
fromLeft, fromRight, fromBottom, fromTop -
pageCurl, pageUnCurl fromLeft, fromRight, fromTop, fromBottom float inputColor[];
cube
alignedCube
fromLeft, fromRight, fromTop, fromBottom float inputAmount; (perspective)
flip
alignedFlip
oglFlip
fromLeft, fromRight, fromTop, fromBottom float inputAmount;
cameraIris - CGPoint inputPosition;
rippleEffect - -
rotate 90cw, 90ccw, 180cw, 180ccw -
suckEffect - CGPoint inputPosition;

Availability

The following shows the availability of different CATransitions starting from 2.0

CATransition Availability
fade
moveIn
push
reveal
(Public API) 2.0–
flip
alignedFlip
oglFlip
2.0–
cube
alignedCube
2.0–
pageCurl
pageUnCurl
2.0–
rippleEffect 2.0–
suckEffect 2.0–
cameraIris
cameraIrisHollowOpen
cameraIrisHollowClose
2.0–
rotate 4.0–
spewEffect
genieEffect
unGenieEffect
twist
swirl
charminUltra
reflection
zoomyIn
zoomyOut
mapCurl
mapUnCurl
oglApplicationSuspend
cameraIrisHollow
2.0–2.2

References