繼承自: CCScene:CCNode:CCResponder:NSObject
聲明自: CCTranslation.h
概述:
A transition animates the PResentation of a new scene while moving the current scene out of view. A transition is optionally played when calling one of the presentScene:withTransition: methods of CCDirector.
當從view中移出當前scene時,transition激活一個新的scene顯示。在調用CCDirector的prensentScene:withTransition方法時,transition是可選的參數.
Note: Since both scenes remain in memory and are being rendered, a transition may raise performance issues or memory warnings. If two complex scenes can not be reliably transitioned from/to it is best to not use transitions or to introduce an in-between scene that is presented only for a short period of time (ie a loading scene or merely a “fade to black” scene).
注意:在底層,所有的scenes都保留在內存中,transition可以會引發性能問題或內存警告。如果兩個復雜的scenes不能有效的被transition,那么最好不要使用transitions或者引入一個僅僅會顯示短時間的內置scene(比如載入scene或者漸漸變黑scene)。
+ transitionMoveInWithDirection:duration:
+ transitionPushWithDirection:duration:
+ transitionRevealWithDirection:duration:
outgoingDownScale
property incomingDownScale
property retinaTransition
property transitionPixelFormat
property transitionDepthStencilFormat
property outgoingSceneAnimated
property incomingSceneAnimated
property
Will downscale incoming scene. Can be used as an effect, or to decrease render time on complex scenes. Default 1.0.
@property (nonatomic, assign) float incomingDownScale
CCTransition.h
Defines whether incoming scene will be animated during transition. Default NO.
定義傳入的scene在transition的過程中是否會被激活,默認為NO。
@property (nonatomic, getter=isIncomingSceneAnimated) BOOL incomingSceneAnimated
CCTransition.h
Will downscale outgoing scene. Can be used as an effect, or to decrease render time on complex scenes. Default 1.0.
可以縮減傳出scene的規模。可以用作一個效果,或者在復雜scenes上減少底層處理所需的時間。
@property (nonatomic, assign) float outgoingDownScale
CCTransition.h
Defines whether outgoing scene will be animated during transition. Default NO.
定義傳出場景在transition過程中是否會被激活。默認NO
@property (nonatomic, getter=isOutgoingSceneAnimated) BOOL outgoingSceneAnimated
CCTransition.h
Normalized (percentage) transition progress in the range 0.0 to 1.0.
把transition的進度規范化在0.0到1.0的范圍內(百分比形式)
@property (nonatomic, readonly) float progress
CCTransition.h
Transition will be performed in retina resolution. Will force outgoingDownScale and incomingDownScale to 1.0 on non retina devices, and 2.0 on retina devices if not set. Default YES.
@property (nonatomic, getter=isRetinaTransition) BOOL retinaTransition
CCTransition.h
The actual transition runtime in seconds.
實際的transition運行時間。
@property (nonatomic, readonly) NSTimeInterval runTime
CCTransition.h
Depth/stencil format used for transition. Default GL_DEPTH24_STENCIL8_OES
.
@property (nonatomic, assign) GLuint transitionDepthStencilFormat
CCTransition.h
Pixel format used for transition. Default CCTexturePixelFormat_RGBA8888
.
@property (nonatomic, assign) CCTexturePixelFormat transitionPixelFormat
CCTransition.h
Creates a cross fade transition directly from outgoing to incoming scene.
創建一個交叉漸變transition。(舊場景 alpha 值從 1 變為 0,新場景的 alpha 值從 0 變為 1,兩個 cross 在一起)
+ (CCTransition *)transitionCrossFadeWithDuration:(NSTimeInterval)duration
The duration of the transition in seconds.
The CCTransition Object.
CCTransition.h
Creates a fade transition from outgoing to incoming scene, through color.
創建一個漸變transition,通過一個color場景。(先從舊場景 cross fade 到這個顏色場景,再從顏色場景 cross fade 到新場景)
+ (CCTransition *)transitionFadeWithColor:(CCColor *)color duration:(NSTimeInterval)duration
The color to fade through
The duration of the transition in seconds.
The CCTransition Object.
CCTransition.h
Creates a fade transition from outgoing to incoming scene, through black.
穿件一個漸變transition,通過一個black場景.
+ (CCTransition *)transitionFadeWithDuration:(NSTimeInterval)duration
The duration of the transition in seconds.
The CCTransition Object.
CCTransition.h
Creates a transition where the incoming scene is moved in over the outgoing scene.
創建一個transtion(效果是新scene像蓋子一樣挪過來蓋在舊scene上面)
注:CCTransitionDirection:
typedef NS_ENUM(NSInteger, CCTransitionDirection ) {
CCTransitionDirectionUp,
CCTransitionDirectionDown,
CCTransitionDirectionRight,
CCTransitionDirectionLeft,
CCTransitionDirectionInvalid = -1,
};
+ (CCTransition *)transitionMoveInWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration
Direction to move the incoming scene.
The duration of the transition in seconds.
The CCTransition Object.
CCTransition.h
Creates a transition where the incoming scene pushed the outgoing scene out.
效果是新scene把舊scene推走,平行移動。
+ (CCTransition *)transitionPushWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration
Direction to move incoming and outgoing scenes.
The duration of the transition in seconds.
The CCTransition Object.
CCTransition.h
Creates a transition where the incoming scene is revealed by sliding the outgoing scene out.
舊場景蓋在新場景下面,然后像揭蓋子一樣把舊的揭掉,新的就露出來了。與 move in 相反,一個是新場景蓋過來,一個是老場景揭出去。
+ (CCTransition *)transitionRevealWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration
Direction to slide outcoing scene.
The duration of the transition in seconds.
The CCTransition Object.
CCTransition.h
新聞熱點
疑難解答