00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #import <UIKit/UIKit.h>
00029
00030 #import "CCAction.h"
00031
00035 @interface CCInstantAction : CCFiniteTimeAction <NSCopying>
00036 {}
00037 @end
00038
00041 @interface CCShow : CCInstantAction
00042 {
00043 }
00044 @end
00045
00048 @interface CCHide : CCInstantAction
00049 {
00050 }
00051 @end
00052
00055 @interface CCToggleVisibility : CCInstantAction
00056 {
00057 }
00058 @end
00059
00063 @interface CCFlipX : CCInstantAction
00064 {
00065 BOOL flipX;
00066 }
00067 +(id) actionWithFlipX:(BOOL)x;
00068 -(id) initWithFlipX:(BOOL)x;
00069 @end
00070
00074 @interface CCFlipY : CCInstantAction
00075 {
00076 BOOL flipY;
00077 }
00078 +(id) actionWithFlipY:(BOOL)y;
00079 -(id) initWithFlipY:(BOOL)y;
00080 @end
00081
00084 @interface CCPlace : CCInstantAction <NSCopying>
00085 {
00086 CGPoint position;
00087 }
00089 +(id) actionWithPosition: (CGPoint) pos;
00091 -(id) initWithPosition: (CGPoint) pos;
00092 @end
00093
00096 @interface CCCallFunc : CCInstantAction <NSCopying>
00097 {
00098 id targetCallback;
00099 SEL selector;
00100 }
00102 +(id) actionWithTarget: (id) t selector:(SEL) s;
00104 -(id) initWithTarget: (id) t selector:(SEL) s;
00106 -(void) execute;
00107 @end
00108
00112 @interface CCCallFuncN : CCCallFunc
00113 {
00114 }
00115 @end
00116
00117
00118 typedef void (*CC_CALLBACK_ND)(id, SEL, id, void *);
00122 @interface CCCallFuncND : CCCallFuncN
00123 {
00124 void *data;
00125 CC_CALLBACK_ND callbackMethod_;
00126 }
00127
00129 @property (nonatomic,readwrite) CC_CALLBACK_ND callbackMethod;
00130
00132 +(id) actionWithTarget: (id) t selector:(SEL) s data:(void*)d;
00134 -(id) initWithTarget:(id) t selector:(SEL) s data:(void*) d;
00135 @end
00136
00137 #pragma mark Blocks Support
00138
00139 #if NS_BLOCKS_AVAILABLE
00140
00143 @interface CCCallBlock : CCInstantAction<NSCopying>
00144 {
00145 void (^block_)();
00146 }
00147
00149 +(id) actionWithBlock:(void(^)())block;
00150
00152 -(id) initWithBlock:(void(^)())block;
00153
00155 -(void) execute;
00156 @end
00157
00158 @class CCNode;
00159
00162 @interface CCCallBlockN : CCInstantAction<NSCopying>
00163 {
00164 void (^block_)(CCNode *);
00165 }
00166
00168 +(id) actionWithBlock:(void(^)(CCNode *node))block;
00169
00171 -(id) initWithBlock:(void(^)(CCNode *node))block;
00172
00174 -(void) execute;
00175 @end
00176
00177 #endif