Inherits from CCActionInterval : CCFiniteTimeAction : CCAction : NSObject
Declared in CCActionTween.h

Overview

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];

Tasks

Class Methods

actionWithDuration:key:from:to:

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

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

Declared In

CCActionTween.h

Instance Methods

initWithDuration:key:from:to:

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

Declared In

CCActionTween.h