CCActionRotateTo Class Reference
Inherits from | CCActionInterval : CCActionFiniteTime : CCAction : NSObject |
---|---|
Conforms to | NSCopying |
Declared in | CCActionInterval.h |
Overview
This action rotates the target to the specified angle. The direction will be decided by the shortest route.
Warning: Rotate actions shouldn’t be used to rotate nodes with a dynamic CCPhysicsBody unless the body has allowsRotation set to NO. Otherwise both the physics body and the action will alter the node’s rotation property, overriding each other’s changes. This leads to unpredictable behavior.
Creating a Rotate Action
+ actionWithDuration:angle:
Creates the action.
+ (id)actionWithDuration:(CCTime)duration angle:(float)angle
Parameters
duration |
Action duration. |
---|---|
angle |
Angle to rotate to (degrees). |
Return Value
New rotate action.
Declared In
CCActionInterval.h
+ actionWithDuration:angle:simple:
Creates the action.
+ (id)actionWithDuration:(CCTime)duration angle:(float)angle simple:(bool)simple
Parameters
duration |
Action duration. |
---|---|
angle |
Angle to rotate to (degrees). |
simple |
Simple rotation, no smart checks. |
Return Value
New rotate action.
Declared In
CCActionInterval.h
– initWithDuration:angle:simple:
Initializes the action.
- (id)initWithDuration:(CCTime)duration angle:(float)angle simple:(bool)simple
Parameters
duration |
Action duration. |
---|---|
angle |
Angle to rotate to (degrees). |
simple |
Simple rotation, no smart checks. |
Return Value
New rotate action
Declared In
CCActionInterval.h
– initWithDuration:angle:
Initializes the action.
- (id)initWithDuration:(CCTime)duration angle:(float)angle
Parameters
duration |
Action duration. |
---|---|
angle |
Angle to rotate to (degrees). |
Return Value
New rotate action
Declared In
CCActionInterval.h
+ actionWithDuration:angleX:
Creates the action with angleX rotation angle.
+ (id)actionWithDuration:(CCTime)t angleX:(float)aX
Parameters
t |
Action duration. |
---|---|
aX |
X rotation in degrees. |
Return Value
New rotate action.
Declared In
CCActionInterval.h
– initWithDuration:angleX:
Initializes the action with angleX rotation angle.
- (id)initWithDuration:(CCTime)t angleX:(float)aX
Parameters
t |
Action duration. |
---|---|
aX |
X rotation in degrees. |
Return Value
New rotate action.
Declared In
CCActionInterval.h
+ actionWithDuration:angleY:
Creates the action with angleY rotation angle.
+ (id)actionWithDuration:(CCTime)t angleY:(float)aY
Parameters
t |
Action duration. |
---|---|
aY |
Y rotation in degrees. |
Return Value
New rotate action.
Declared In
CCActionInterval.h
– initWithDuration:angleY:
Initializes the action with angleY rotation angle.
- (id)initWithDuration:(CCTime)t angleY:(float)aY
Parameters
t |
Action duration. |
---|---|
aY |
Y rotation in degrees. |
Return Value
New rotate action.
Declared In
CCActionInterval.h