ActionInterval
Class
Extends FiniteTimeAction
Module: cc
An interval action is an action that takes place within a certain period of time.
It has an start time, and a finish time. The finish time is the parameter
duration plus the start time.
These CCActionInterval actions have some interesting properties, like:
- They can run normally (default)
- They can run reversed with the reverse method
- They can run with the time altered with the Accelerate, AccelDeccel and Speed actions.
For example, you can simulate a Ping Pong effect running the action normally and
then running it again in Reverse mode.
Index
Methods
easing
Implementation of ease motion.repeat
Repeats an action a number of times.repeatForever
Repeats an action for ever.getDuration
get duration of the action.setDuration
set duration of the action.reverse
Returns a reversed action.clone
to copy object with deep copy.isDone
return true if the action has finished.getTarget
get the target.setTarget
The action will modify the target properties.getOriginalTarget
get the original target.getTag
get tag number.setTag
set tag number.
Details
Methods
easing
Implementation of ease motion.
meta | description |
---|---|
Returns | ActionInterval |
Defined in | cocos2d/actions/CCActionInterval.js:121 |
Parameters
easeObj
Object
Examples
action.easing(cc.easeIn(3.0));
repeat
Repeats an action a number of times. To repeat an action forever use the CCRepeatForever action.
meta | description |
---|---|
Returns | ActionInterval |
Defined in | cocos2d/actions/CCActionInterval.js:249 |
Parameters
times
Number
repeatForever
Repeats an action for ever.
To repeat the an action for a limited number of times use the Repeat action.
meta | description |
---|---|
Returns | ActionInterval |
Defined in | cocos2d/actions/CCActionInterval.js:269 |
getDuration
get duration of the action. (seconds).
meta | description |
---|---|
Returns | Number |
Defined in | cocos2d/actions/CCAction.js:205 |
setDuration
set duration of the action. (seconds).
meta | description |
---|---|
Defined in | cocos2d/actions/CCAction.js:215 |
Parameters
duration
Number
reverse
Returns a reversed action.
For example:
- The action will be x coordinates of 0 move to 100.
- The reversed action will be x of 100 move to 0.
- Will be rewritten
meta | description |
---|---|
Returns | Null |
Defined in | cocos2d/actions/CCAction.js:225 |
clone
to copy object with deep copy. returns a clone of action.
meta | description |
---|---|
Returns | FiniteTimeAction |
Defined in | cocos2d/actions/CCAction.js:241 |
isDone
return true if the action has finished.
meta | description |
---|---|
Returns | Boolean |
Defined in | cocos2d/actions/CCAction.js:70 |
getTarget
get the target.
meta | description |
---|---|
Returns | Node |
Defined in | cocos2d/actions/CCAction.js:102 |
setTarget
The action will modify the target properties.
meta | description |
---|---|
Defined in | cocos2d/actions/CCAction.js:112 |
Parameters
target
Node
getOriginalTarget
get the original target.
meta | description |
---|---|
Returns | Node |
Defined in | cocos2d/actions/CCAction.js:122 |
getTag
get tag number.
meta | description |
---|---|
Returns | Number |
Defined in | cocos2d/actions/CCAction.js:139 |
setTag
set tag number.
meta | description |
---|---|
Defined in | cocos2d/actions/CCAction.js:149 |
Parameters
tag
Number