标签:
Inherits from | NSObject |
Conforms to | NSCopying |
Declared in | CCAction.h |
CCAction is an abstract base class for all actions. Actions animate nodes by manipulating node properties over time such as position, rotation, scale and opacity.
CCaction是一个关于所有动作的基本类型。通过操纵node属性,比如位置,旋转,透明度,规模等,激活Nodes。
For more information see the Concepts:Actions article in the Developer Guide
The following actions inherit directly from CCAction and can be used “as is”:
These action subclasses are abstract base classes for instant and “over time” actions, see their references for more information:
target
property originalTarget
property tag
property@property (nonatomic, readonly, unsafe_unretained) id originalTarget
CCAction.h
The “target” is typically the node instance that received the [CCNode runAction:] message. The action will modify the target properties. The target will be set with the ‘startWithTarget’ method. When the ‘stop’ method is called, target will be set to nil.
"target”是典型的node实例,可以接收[CCNode runAction:] 方法。acition会定义target属性。target可以通过startWithTarget方法设置,当stop方法被调用时,target会被置为nil。
@property (nonatomic, readonly, unsafe_unretained) id target
Warning: The target is ‘assigned’ (unsafe unretained), it is not ‘retained’ nor managed by ARC.
CCAction.h
Initializes and returns an action object.
初始化和返回一个action对象。
- (id)init
An initialized CCAction Object.
CCAction.h
Return YES if the action has finished.
- (BOOL)isDone
Action completion status
动作完成状态。
CCAction.h
Assigns a target to the action Called before the action is started.
分配一个target给action。这回在action开始之前被调用。
- (void)startWithTarget:(id)target
Target to assign to action (weak reference).
CCAction.h
Steps the action. Called for every frame with step interval.
action的步骤。每一帧被调用,步骤间隔。
- (void)step:(CCTime)dt
Ellapsed interval since last step.
Note: Do not override unless you know what you are doing.
CCAction.h
Stops the action Called after the action has finished. Will assign the internal target reference to nil. Note: You should never call this method directly. In stead use: [target stopAction:action]
停止一个action,action结束后被调用。会让内部的target置为nil。
你永远不应该直接调用这个方法。用[target stopAction:action]代替。
- (void)stop
CCAction.h
Updates the action with normalized value.
用规范化的值更新动作。
- (void)update:(CCTime)time
Normalized action progress.
For example: A value of 0.5 indicates that the action is 50% complete.
CCAction.h
Inherits from | CCActionFiniteTime : CCAction : NSObject |
Conforms to | NSCopying |
Declared in | CCActionInterval.h |
Abstract base class for interval actions. An interval action is an action that performs its task over a certain period of time.
关于间隔动作的抽象基本类。一个间隔动作是指一个动作在一段时间内完成整个过程。
Most CCActionInterval actions can be reversed or have their speed altered via the CCActionSpeed action.
大部分的CCActionInterval动作可以被逆转或者改变速率,通过CCActionSpeed动作。
elapsed
propertyInitializes and returns an action interval object.
- (id)initWithDuration:(CCTime)d
Action interval.
An initialized CCActionInterval Object.
CCActionInterval.h
Returns YES if the action has finished.
- (BOOL)isDone
Action finished status.
CCActionInterval.h
Returns a reversed action.
- (CCActionInterval *)reverse
Created reversed action.
CCActionInterval.h
Inherits from | CCActionMoveBy : CCActionInterval : CCActionFiniteTime : CCAction : NSObject |
Declared in | CCActionInterval.h |
This action moves the target to the position specified, these are absolute coordinates. Several CCMoveTo actions can be concurrently called, and the resulting movement will be the sum of individual movements.
Warning: Move actions shouldn’t be used to move nodes with a dynamic CCPhysicsBody as both the physics body and the action will alter the node’s position property, overriding each other’s changes. This leads to unpredictable behavior.
CCAction Class 和 CCActionInterval Class 和 CCActionMoveTo Class ---Cocos2D-Swift v3.3
标签:
原文地址:http://www.cnblogs.com/somebod-Y/p/4264413.html