cocos2d-iphone  2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
CCActionTween Class Reference

#import <CCActionTween.h>

Inheritance diagram for CCActionTween:
Collaboration diagram for CCActionTween:

Instance Methods

(id) - initWithDuration:key:from:to:
 
 Instance Methods inherited from CCActionInterval
(id) - initWithDuration:
 
(BOOL) - isDone
 
(CCActionInterval *) - reverse
 

Class Methods

(id) + actionWithDuration:key:from:to:
 
 Class Methods inherited from CCActionInterval
(id) + actionWithDuration:
 

Protected Attributes

NSString * key_
 
float from_
 
float to_
 
float delta_
 
 Protected Attributes inherited from CCActionInterval
ccTime elapsed_
 
BOOL firstTick_
 
 Protected Attributes inherited from CCFiniteTimeAction
ccTime duration_
 duration in seconds
 
 Protected Attributes inherited from CCAction
id originalTarget_
 
id target_
 
NSInteger tag_
 

Additional Inherited Members

 Properties inherited from CCActionInterval
ccTime elapsed
 

Detailed Description

CCActionTween

CCActionTween is an action that lets you update any property of an object. For example, if you want to modify the "width" property of a target from 200 to 300 in 2 seconds, then:

id modifyWidth = [CCActionTween actionWithDuration:2 key:"width" from:200 to:300]; [target runAction:modifyWidth];

Another example: CCScaleTo action could be rewriten using CCPropertyAction:

scaleA and scaleB are equivalents id scaleA = [CCScaleTo actionWithDuration:2 scale:3]; id scaleB = [CCActionTween actionWithDuration:2 key:"scale" from:1 to:3];

Since
v0.99.2

Method Documentation

+ (id) actionWithDuration: (ccTime aDuration
key: (NSString *)  key
from: (float)  from
to: (float)  to 

creates an initializes the action with the property name (key), and the from and to parameters.

- (id) initWithDuration: (ccTime aDuration
key: (NSString *)  key
from: (float)  from
to: (float)  to 

initializes the action with the property name (key), and the from and to parameters.


The documentation for this class was generated from the following file: