cocos2d-iphone-extensions  0.2
Cocos2D Extensions API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Properties
CCSendMessages Class Reference

List of all members.

Public Member Functions

(id) - initWithTarget:
(id) - addMessage
(void) - addInvocation:
(void) - execute

Static Public Member Functions

(id) + actionWithTarget:

Detailed Description

sends messsages to a target when it is run.

It is different than the CCCallFunc classes in that any message can be sent to a target regardless of the number/type of arguments.

NOTE: Any selector in the NSObject class and any selector in the NSObject and NSCopying protocals cannot be added via -addMessage. If you need to call one of those selectors, create an NSInvocation and add it via -addInvocation:.

Usage: Create a CCSendMessages instance with a target using -initWithTarget: or +actionWithTarget:

Add message call(s) to it: (assuming sendMessages is your CCSendMessages object) [[sendMessages addMessage] setOpacity:0.5]; [[sendMessages addMessage] long:0.5 selector:obj example:ccp(3,3)];

Run it on a CCNode with -runAction:, or add it to a CCSequence to run it later on!

Also, arguments don't have to be Objective-C objects.


Member Function Documentation

+ (id) actionWithTarget: (id)  t

Creates CCSendMessages action with given target.

See also:
- initWithTarget:
- (void) addInvocation: (NSInvocation *)  invocation

Adds NSInvocation to internal CCStoredMessages, use this method to send NSObject & NSCopying selectors to a target.

- (id) addMessage

Returns CCStoredMessages that is stored internally to capture Objective-C messages.

- (void) execute

Sends all captured messages to a target.

You don't need to use this method directly - use CCNode::runAction: instead.

- (id) initWithTarget: (id)  t

Init CCSendMessages action with given target

Parameters:
tTarget, which will receive messages.

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