Public Member Functions | Static Public Member Functions

CCPropertyAction Class Reference

#import <CCPropertyAction.h>

Inherits CCIntervalAction.

Collaboration diagram for CCPropertyAction:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(id) - initWithDuration:key:from:to:

Static Public Member Functions

(id) + actionWithDuration:key:from:to:

Detailed Description

CCPropertyAction

CCPropertyAction 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 senconds, then:

id modifyWidth = [CCPropertyAction 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 = [CCPropertyAction actionWithDuration:2 key:"scale" from:1 to:3];

Since:
v0.99.2

Definition at line 48 of file CCPropertyAction.h.


Member Function 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:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

cocos2d for iPhone 0.99.4 API Reference - Generated using Doxygen 1.7.1