CCActionMoveBy Class Reference
Inherits from | CCActionInterval : CCActionFiniteTime : CCAction : NSObject |
---|---|
Conforms to | NSCopying |
Declared in | CCActionInterval.h |
Overview
This action moves the target by the x,y values in the specified point value. X and Y are relative to the position of the object. Several CCMoveBy 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.
Creating a Move Action
+ actionWithDuration:position:
Creates the action.
+ (id)actionWithDuration:(CCTime)duration position:(CGPoint)deltaPosition
Parameters
duration |
Action interval. |
---|---|
deltaPosition |
Delta position. |
Return Value
New moveby action.
Declared In
CCActionInterval.h
– initWithDuration:position:
Initializes the action.
- (id)initWithDuration:(CCTime)duration position:(CGPoint)deltaPosition
Parameters
duration |
Action interval. |
---|---|
deltaPosition |
Delta position. |
Return Value
New moveby action.
Declared In
CCActionInterval.h