forked from mono/monotouch-bindings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcocos2d.cs
467 lines (341 loc) · 11.5 KB
/
cocos2d.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
//
// cocos2d.cs: API definition for Cocos2D binding to Mono.
//
// Author:
// Miguel de Icaza
//
// Copyright 2011 Xamarin, Inc.
//
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.ObjCRuntime;
namespace MonoTouch.Cocos2D {
[BaseType (typeof (NSObject))]
interface CCActionManager {
[Export ("sharedManager")]
CCActionManager SharedManager { get; }
[Static]
[Export ("purgeSharedManager")]
void PurgeSharedManager ();
[Export ("addAction:actiontarget:paused:")]
void AddAction (CCAction action, NSObject target, bool paused);
[Export ("removeAllActions")]
void RemoveAllActions ();
[Export ("removeAllActionsFromTarget:")]
void RemoveActions (NSObject target);
[Export ("removeAction")]
void RemoveAction (CCAction action);
[Export ("removeActionByTag:target:")]
void RemoveAction (int tag, NSObject target);
[Export ("getActionByTag:tagtarget:")]
CCAction GetAction (int tag, NSObject target);
[Export ("numberOfRunningActionsInTarget:")]
uint ActionsInTarget (NSObject target);
[Export ("pauseTarget:")]
void PauseTarget (NSObject target);
[Export ("resumeTarget:")]
void ResumeTarget (NSObject target);
}
[BaseType (typeof (NSObject))]
interface CCAction {
[Export ("originalTarget")]
NSObject OriginalTarget { get; }
[Export ("tag")]
int Tag { get; set; }
[Export ("idtarget")]
NSObject Target { get; }
[Static]
[Export ("action")]
CCAction CreateAction ();
[Export ("init")]
IntPtr Constructor ();
//[Export ("copyWithZone:")]
//NSObject CopyFromZone (NSZone zone );
[Export ("isDone")]
bool IsDone { get; }
[Export ("startWithTarget:")]
void StartWithTarget (NSObject target);
[Export ("stop")]
void Stop ();
[Export ("step:")]
void Step (float ccTime);
[Export ("update:")]
void Update (float time);
}
[BaseType (typeof (CCAction))]
interface CCFiniteTimeAction {
[Export ("duration")]
float Duration { get; set; }
[Export ("reverse")]
CCFiniteTimeAction Reverse ();
}
[BaseType (typeof (CCAction))]
interface CCRepeatForever {
[Export ("innerAction")]
CCActionInterval InnerAction { get; set; }
[Static]
[Export ("actionWithAction:")]
CCRepeatForever FromAction (CCActionInterval action);
[Export ("initWithAction:")]
IntPtr Constructor (CCActionInterval action);
}
[BaseType (typeof (CCAction))]
interface CCSpeed {
[Export ("innerAction")]
CCActionInterval InnerAction { get; set; }
[Export ("speed")]
float Speed { get; set; }
[Static]
[Export ("actionWithAction:speed:")]
NSObject FromAction (CCActionInterval action, float rate);
[Export ("initWithAction:actionspeed:")]
IntPtr Constructor (CCActionInterval action, float rate);
}
[BaseType (typeof (CCAction))]
interface CCFollow {
[Export ("boundarySet")]
bool BoundarySet { get; set; }
[Static]
[Export ("actionWithTarget:")]
CCFollow FromAction (CCNode followedNode);
[Static]
[Export ("actionWithTarget:worldBoundary:")]
CCFollow FromAction (CCNode followedNode, RectangleF worldBoundary);
[Export ("initWithTarget:")]
IntPtr Constructor (CCNode followedNode);
[Export ("initWithTarget:worldBoundary:")]
IntPtr Constructor (CCNode followedNode, RectangleF worldBoundary);
}
[BaseType (typeof (CCFiniteTimeAction))]
interface CCActionInterval {
[Export ("elapsed")]
float Elapsed { get; }
[Static]
[Export ("actionWithDuration:")]
CCActionInterval Create (float duration);
[Export ("initWithDuration:")]
IntPtr Constructor (float duration);
[Export ("isDone")]
bool IsDone { get; }
[Export ("reverse")]
CCActionInterval Reverse ();
}
[BaseType (typeof (CCActionInterval))]
interface CCSequence {
[Static]
[Export ("actionsWithArray:actions")]
CCSequence FromActions (CCFiniteTimeAction [] actions);
[Static]
[Export ("actionOne:two:")]
CCSequence FromActions (CCFiniteTimeAction first, CCFiniteTimeAction second);
[Export ("initOne:two:")]
IntPtr Constructor (CCFiniteTimeAction first, CCFiniteTimeAction second);
}
[BaseType (typeof (CCActionInterval))]
interface CCRepeat {
[Export ("innerAction")]
CCFiniteTimeAction InnerAction { get; set; }
[Static]
[Export ("actionWithAction:times:")]
NSObject FromAction (CCFiniteTimeAction [] actions, int count);
[Export ("initWithAction:times:")]
IntPtr Constructor (CCFiniteTimeAction action, int count);
}
[BaseType (typeof (CCActionInterval))]
interface CCSpawn {
[Static]
[Export ("actionsWithArray:")]
CCSpawn FromActions (CCFiniteTimeAction [] actions );
[Static]
[Export ("actionOne:onetwo:two")]
CCSpawn FromActions (CCFiniteTimeAction first , CCFiniteTimeAction second);
[Export ("initOne:onetwo:two")]
IntPtr Constructor (CCFiniteTimeAction first , CCFiniteTimeAction second);
}
[BaseType (typeof (CCActionInterval))]
interface CCRotateTo {
[Export ("actionWithDuration:angle:")]
CCRotateTo Create (float duration, float angle);
[Export ("initWithDuration:angle:")]
IntPtr Constructor (float duration, float angle);
}
[BaseType (typeof (CCActionInterval))]
interface CCRotateBy {
[Export ("actionWithDuration:angle:")]
CCRotateBy Create (float duration, float deltaAngle);
[Export ("initWithDuration:angle:")]
IntPtr Constructor (float duration, float deltaAngle);
}
[BaseType (typeof (CCActionInterval))]
interface CCMoveTo {
[Export ("actionWithDuration:position:")]
CCMoveTo Create (float duration, PointF position);
[Export ("initWithDuration:position:")]
IntPtr Constructor (float duration, PointF position);
}
[BaseType (typeof (CCMoveTo))]
interface CCMoveBy {
[Static]
[Export ("actionWithDuration:position:")]
CCMoveBy Create (float duration, PointF deltaPosition);
[Export ("initWithDuration:position:")]
IntPtr Constructor (float duration, PointF deltaPosition);
}
[BaseType (typeof (CCActionInterval))]
interface CCSkewTo {
[Static]
[Export ("actionWithDuration:skewX:skewY:")]
CCSkewTo Create (float duration, float sx, float sy);
[Export ("initWithDuration:skewX:skewY:")]
CCSkewTo Constructor (float duration, float sx, float sy);
}
[BaseType (typeof (CCSkewTo))]
interface CCSkewBy {
[Static]
[Export ("actionWithDuration:skewX:skewY:")]
CCSkewBy Create (float duration, float sx, float sy);
[Export ("initWithDuration:skewX:skewY:")]
CCSkewBy Constructor (float duration, float sx, float sy);
}
[BaseType (typeof (CCActionInterval))]
interface CCJumpBy {
[Export ("actionWithDuration:position:height:jumps:")]
NSObject ActionWithDurationtbezierc (float duration, PointF position, float height, int jumps);
[Export ("initWithDuration:position:height:jumps:")]
IntPtr Constructor (float duration, PointF position, float height, int jumps);
}
[BaseType (typeof (CCActionInterval))]
interface CCBezierBy {
[Export ("actionWithDuration:bezier:")]
CCBezierBy Create (float duration, CCBezierConfig config);
[Export ("initWithDuration:bezier:")]
IntPtr Constructor (float duration, CCBezierConfig config);
}
[BaseType (typeof (CCBezierBy))]
interface CCBezierTo {
[Export ("actionWithDuration:bezier:")]
CCBezierTo Create (float duration, CCBezierConfig config);
[Export ("initWithDuration:bezier:")]
IntPtr Constructor (float duration, CCBezierConfig config);
}
[BaseType (typeof (CCActionInterval))]
interface CCScaleTo {
[Static]
[Export ("actionWithDuration:scale:")]
CCScaleTo Create (float duration, float scale);
[Export ("initWithDuration:scale:s")]
IntPtr Constructor (float duration, float scale);
[Static]
[Export ("actionWithDuration:scaleX:scaleY:")]
CCScaleTo Create (float duration, float sx, float sy);
[Export ("initWithDuration:scaleX:scaleY:")]
IntPtr Constructor (float duration, float sx, float sy);
}
[BaseType (typeof (CCScaleTo))]
interface CCScaleBy {
[Static]
[Export ("actionWithDuration:scale:")]
CCScaleBy Create (float duration, float scale);
[Export ("initWithDuration:scale:s")]
IntPtr Constructor (float duration, float scale);
[Static]
[Export ("actionWithDuration:scaleX:scaleY:")]
CCScaleBy Create (float duration, float sx, float sy);
[Export ("initWithDuration:scaleX:scaleY:")]
IntPtr Constructor (float duration, float sx, float sy);
}
[BaseType (typeof (CCActionInterval))]
interface CCBlink {
[Static]
[Export ("actionWithDuration:blinks:")]
NSObject Create (float duration, int blinks);
[Export ("initWithDuration:blinks:")]
IntPtr Constructor (float duration, int blinks);
}
[BaseType (typeof (CCActionInterval))]
interface CCFadeIn {
}
[BaseType (typeof (CCActionInterval))]
interface CCFadeOut {
}
[BaseType (typeof (CCActionInterval))]
interface CCFadeTo {
[Static, Export ("actionWithDuration:opacity:")]
CCFadeTo Create (float duration, byte opactiy);
[Export ("initWithDuration:opacity:")]
IntPtr Constructor (float duration, byte opacity);
}
[BaseType (typeof (CCActionInterval))]
interface CCTintTo {
[Static, Export ("actionWithDuration:red:green:blue:")]
CCTintTo Create (float duration, byte red, byte green, byte blue);
[Export ("initWithDuration:red:green:blue:")]
IntPtr Constructor (float duration, byte red, byte green, byte blue);
}
[BaseType (typeof (CCActionInterval))]
interface CCTintBy {
[Export ("actionWithDuration:red:green:blue:")]
CCTintBy Create (float duration, byte red, byte green, byte blue);
[Export ("initWithDuration:red:green:blue:")]
IntPtr Constructor (float duration, byte red, byte green, byte blue);
}
[BaseType (typeof (CCActionInterval))]
interface CCDelayTime {
}
[BaseType (typeof (CCActionInterval))]
interface CCReverseTime {
[Static, Export ("actionWithAction:")]
NSObject Create (CCFiniteTimeAction action);
[Export ("initWithAction:")]
IntPtr Constructor (CCFiniteTimeAction action);
}
[BaseType (typeof (CCActionInterval))]
interface CCAnimate {
[Export ("animation")]
CCAnimation Animation { get; set; }
[Static]
[Export ("actionWithAnimation:")]
CCAnimate FromAnimation (CCAnimation animation);
[Export ("initWithAnimation:a")]
IntPtr Constructor (CCAnimation animation);
[Static]
[Export ("actionWithAnimation:restoreOriginalFrame:")]
CCAnimate Create (CCAnimation animation , bool restoreOriginalFrame);
[Export ("initWithAnimation:restoreOriginalFrame:")]
IntPtr Constructor (CCAnimation animation, bool restoreOriginalFrame);
[Static]
[Export ("actionWithDuration:animation:restoreOriginalFrame:")]
CCAnimate Create (float duration, CCAnimation animation, bool restoreOriginalFrame);
[Export ("initWithDuration:animation:restoreOriginalFrame:")]
IntPtr Constructor (float duration, CCAnimation animation, bool restoreOriginalFrame);
}
[BaseType (typeof (NSObject))]
interface CCAnimation {
[Export ("delay")]
float Delay { get; set; }
[Export ("frames")]
CCSpriteFrame [] Frames { get; set; }
[Export ("name")]
string Name { get; set; }
[Static]
[Export ("animation")]
NSObject Create ();
[Static]
[Export ("animationWithFrames:")]
CCAnimation FromFrames (CCSpriteFrame [] frames);
[Static]
[Export ("animationWithFrames:delay:")]
CCAnimation FromFrames (CCSpriteFrame [] frames, float delay);
[Export ("initWithFrames:")]
IntPtr Constructor (CCSpriteFrame [] frames);
[Export ("initWithFrames:delay:")]
IntPtr Constructor (CCSpriteFrame [] frames, float delay);
[Export ("addFrame:")]
void AddFrame (CCSpriteFrame frame);
[Export ("addFrameWithFilename:")]
void AddFrame (string filename);
[Export ("addFrameWithTexture:rect:")]
void AddFrame (CCTexture2D texture, RectangleF rect);
}
}