-
Notifications
You must be signed in to change notification settings - Fork 0
/
creator.d.ts
12143 lines (11586 loc) · 435 KB
/
creator.d.ts
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
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/** !#en
The main namespace of Cocos2d-JS, all engine core classes, functions, properties and constants are defined in this namespace.
!#zh
Cocos 引擎的主要命名空间,引擎代码中所有的类,函数,属性和常量都在这个命名空间中定义。 */
declare module cc {
/** !#en Init Debug setting.
!#zh 设置调试模式。
*/
export function _initDebugSetting(mode : DebugMode) : void;
/** !#en
Outputs an error message to the Cocos Creator Console (editor) or Web Console (runtime).<br/>
- In Cocos Creator, error is red.<br/>
- In Chrome, error have a red icon along with red message text.<br/>
!#zh
输出错误消息到 Cocos Creator 编辑器的 Console 或运行时页面端的 Console 中。<br/>
- 在 Cocos Creator 中,错误信息显示是红色的。<br/>
- 在 Chrome 中,错误信息有红色的图标以及红色的消息文本。<br/>
@param obj A JavaScript string containing zero or more substitution strings.
@param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.
*/
export function error(obj : any, subst : any) : void;
/** !#en
Outputs a warning message to the Cocos Creator Console (editor) or Web Console (runtime).
- In Cocos Creator, warning is yellow.
- In Chrome, warning have a yellow warning icon with the message text.
!#zh
输出警告消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。<br/>
- 在 Cocos Creator 中,警告信息显示是黄色的。<br/>
- 在 Chrome 中,警告信息有着黄色的图标以及黄色的消息文本。<br/>
@param obj A JavaScript string containing zero or more substitution strings.
@param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.
*/
export function warn(obj : any, subst : any) : void;
/** !#en Outputs a message to the Cocos Creator Console (editor) or Web Console (runtime).
!#zh 输出一条消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。
@param obj A JavaScript string containing zero or more substitution strings.
@param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.
*/
export function log(obj : any, subst : any) : void;
/** !#en
Outputs an informational message to the Cocos Creator Console (editor) or Web Console (runtime).
- In Cocos Creator, info is blue.
- In Firefox and Chrome, a small "i" icon is displayed next to these items in the Web Console's log.
!#zh
输出一条信息消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。
- 在 Cocos Creator 中,Info 信息显示是蓝色的。<br/>
- 在 Firefox 和 Chrome 中,Info 信息有着小 “i” 图标。
@param obj A JavaScript string containing zero or more substitution strings.
@param subst JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.
*/
export function info(obj : any, subst : any) : void;
/** !#en
Creates the speed action which changes the speed of an action, making it take longer (speed > 1)
or less (speed < 1) time. <br/>
Useful to simulate 'slow motion' or 'fast forward' effect.
!#zh 修改目标动作的速率。
@example
```js
// change the target action speed;
var action = cc.scaleTo(0.2, 1, 0.6);
var newAction = cc.speed(action, 0.5);
```
*/
export function speed(action : ActionInterval, speed : number) : Action;
/** !#en Create a follow action which makes its target follows another node.
!#zh 追踪目标节点的位置。
@example
```js
// example
// creates the action with a set boundary
var followAction = cc.follow(targetNode, cc.rect(0, 0, screenWidth * 2 - 100, screenHeight));
node.runAction(followAction);
// creates the action with no boundary set
var followAction = cc.follow(targetNode);
node.runAction(followAction);
```
*/
export function follow(followedNode : Node, rect : Rect) : Action;
/** Points setter
*/
export function setPoints(points : any[]) : void;
/** !#en Creates an action with a Cardinal Spline array of points and tension.
!#zh 按基数样条曲线轨迹移动到目标位置。
@param points array of control points
@example
```js
//create a cc.CardinalSplineTo
var action1 = cc.cardinalSplineTo(3, array, 0);
```
*/
export function cardinalSplineTo(duration : number, points : any[], tension : number) : ActionInterval;
/** update position of target
*/
export function updatePosition(newPos : Vec2) : void;
/** !#en Creates an action with a Cardinal Spline array of points and tension.
!#zh 按基数样条曲线轨迹移动指定的距离。
*/
export function cardinalSplineBy(duration : number, points : any[], tension : number) : ActionInterval;
/** !#en Creates an action with a Cardinal Spline array of points and tension.
!#zh 按 Catmull Rom 样条曲线轨迹移动到目标位置。
@example
```js
var action1 = cc.catmullRomTo(3, array);
```
*/
export function catmullRomTo(dt : number, points : any[]) : ActionInterval;
/** !#en Creates an action with a Cardinal Spline array of points and tension.
!#zh 按 Catmull Rom 样条曲线轨迹移动指定的距离。
@example
```js
var action1 = cc.catmullRomBy(3, array);
```
*/
export function catmullRomBy(dt : number, points : any[]) : ActionInterval;
/** !#en
Creates the action easing object with the rate parameter. <br />
From slow to fast.
!#zh 创建 easeIn 缓动对象,由慢到快。
@example
```js
// example
action.easing(cc.easeIn(3.0));
```
*/
export function easeIn(rate : number) : any;
/** !#en
Creates the action easing object with the rate parameter. <br />
From fast to slow.
!#zh 创建 easeOut 缓动对象,由快到慢。
@example
```js
// example
action.easing(cc.easeOut(3.0));
```
*/
export function easeOut(rate : number) : any;
/** !#en
Creates the action easing object with the rate parameter. <br />
Slow to fast then to slow.
!#zh 创建 easeInOut 缓动对象,慢到快,然后慢。
@example
```js
//The new usage
action.easing(cc.easeInOut(3.0));
```
*/
export function easeInOut(rate : number) : any;
/** !#en
Creates the action easing object with the rate parameter. <br />
Reference easeInExpo: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeExponentialIn 缓动对象。<br />
EaseExponentialIn 是按指数函数缓动进入的动作。<br />
参考 easeInExpo:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
// example
action.easing(cc.easeExponentialIn());
```
*/
export function easeExponentialIn() : any;
/** !#en
Creates the action easing object. <br />
Reference easeOutExpo: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeExponentialOut 缓动对象。<br />
EaseExponentialOut 是按指数函数缓动退出的动作。<br />
参考 easeOutExpo:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
// example
action.easing(cc.easeExponentialOut());
```
*/
export function easeExponentialOut() : any;
/** !#en
Creates an EaseExponentialInOut action easing object. <br />
Reference easeInOutExpo: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeExponentialInOut 缓动对象。<br />
EaseExponentialInOut 是按指数函数缓动进入并退出的动作。<br />
参考 easeInOutExpo:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
// example
action.easing(cc.easeExponentialInOut());
```
*/
export function easeExponentialInOut() : any;
/** !#en
Creates an EaseSineIn action. <br />
Reference easeInSine: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 EaseSineIn 缓动对象。<br />
EaseSineIn 是按正弦函数缓动进入的动作。<br />
参考 easeInSine:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
// example
action.easing(cc.easeSineIn());
```
*/
export function easeSineIn() : any;
/** !#en
Creates an EaseSineOut action easing object. <br />
Reference easeOutSine: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 EaseSineOut 缓动对象。<br />
EaseSineIn 是按正弦函数缓动退出的动作。<br />
参考 easeOutSine:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
// example
action.easing(cc.easeSineOut());
```
*/
export function easeSineOut() : any;
/** !#en
Creates the action easing object. <br />
Reference easeInOutSine: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeSineInOut 缓动对象。<br />
EaseSineIn 是按正弦函数缓动进入并退出的动作。<br />
参考 easeInOutSine:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
// example
action.easing(cc.easeSineInOut());
```
*/
export function easeSineInOut() : any;
/** !#en
Creates the action easing obejct with the period in radians (default is 0.3). <br />
Reference easeInElastic: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeElasticIn 缓动对象。<br />
EaseElasticIn 是按弹性曲线缓动进入的动作。<br />
参数 easeInElastic:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
// example
action.easing(cc.easeElasticIn(3.0));
```
*/
export function easeElasticIn(period : number) : any;
/** !#en
Creates the action easing object with the period in radians (default is 0.3). <br />
Reference easeOutElastic: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeElasticOut 缓动对象。<br />
EaseElasticOut 是按弹性曲线缓动退出的动作。<br />
参考 easeOutElastic:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
// example
action.easing(cc.easeElasticOut(3.0));
```
*/
export function easeElasticOut(period : number) : any;
/** !#en
Creates the action easing object with the period in radians (default is 0.3). <br />
Reference easeInOutElastic: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeElasticInOut 缓动对象。<br />
EaseElasticInOut 是按弹性曲线缓动进入并退出的动作。<br />
参考 easeInOutElastic:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
// example
action.easing(cc.easeElasticInOut(3.0));
```
*/
export function easeElasticInOut(period : number) : any;
/** !#en
Creates the action easing object. <br />
Eased bounce effect at the beginning.
!#zh
创建 easeBounceIn 缓动对象。<br />
EaseBounceIn 是按弹跳动作缓动进入的动作。
@example
```js
// example
action.easing(cc.easeBounceIn());
```
*/
export function easeBounceIn() : any;
/** !#en
Creates the action easing object. <br />
Eased bounce effect at the ending.
!#zh
创建 easeBounceOut 缓动对象。<br />
EaseBounceOut 是按弹跳动作缓动退出的动作。
@example
```js
// example
action.easing(cc.easeBounceOut());
```
*/
export function easeBounceOut() : any;
/** !#en
Creates the action easing object. <br />
Eased bounce effect at the begining and ending.
!#zh
创建 easeBounceInOut 缓动对象。<br />
EaseBounceInOut 是按弹跳动作缓动进入并退出的动作。
@example
```js
// example
action.easing(cc.easeBounceInOut());
```
*/
export function easeBounceInOut() : any;
/** !#en
Creates the action easing object. <br />
In the opposite direction to move slowly, and then accelerated to the right direction.
!#zh
创建 easeBackIn 缓动对象。<br />
easeBackIn 是在相反的方向缓慢移动,然后加速到正确的方向。<br />
@example
```js
// example
action.easing(cc.easeBackIn());
```
*/
export function easeBackIn() : any;
/** !#en
Creates the action easing object. <br />
Fast moving more than the finish, and then slowly back to the finish.
!#zh
创建 easeBackOut 缓动对象。<br />
easeBackOut 快速移动超出目标,然后慢慢回到目标点。
@example
```js
// example
action.easing(cc.easeBackOut());
```
*/
export function easeBackOut() : any;
/** !#en
Creates the action easing object. <br />
Begining of cc.EaseBackIn. Ending of cc.EaseBackOut.
!#zh
创建 easeBackInOut 缓动对象。<br />
@example
```js
// example
action.easing(cc.easeBackInOut());
```
*/
export function easeBackInOut() : any;
/** !#en
Creates the action easing object. <br />
Into the 4 reference point. <br />
To calculate the motion curve.
!#zh
创建 easeBezierAction 缓动对象。<br />
EaseBezierAction 是按贝塞尔曲线缓动的动作。
@param p0 The first bezier parameter
@param p1 The second bezier parameter
@param p2 The third bezier parameter
@param p3 The fourth bezier parameter
@example
```js
// example
action.easing(cc.easeBezierAction(0.5, 0.5, 1.0, 1.0));
```
*/
export function easeBezierAction(p0 : number, p1 : number, p2 : number, p3 : number) : any;
/** !#en
Creates the action easing object. <br />
Reference easeInQuad: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeQuadraticActionIn 缓动对象。<br />
EaseQuadraticIn是按二次函数缓动进入的动作。<br />
参考 easeInQuad:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.easeQuadraticActionIn());
```
*/
export function easeQuadraticActionIn() : any;
/** !#en
Creates the action easing object. <br />
Reference easeOutQuad: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeQuadraticActionOut 缓动对象。<br />
EaseQuadraticOut 是按二次函数缓动退出的动作。<br />
参考 easeOutQuad:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.easeQuadraticActionOut());
```
*/
export function easeQuadraticActionOut() : any;
/** !#en
Creates the action easing object. <br />
Reference easeInOutQuad: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeQuadraticActionInOut 缓动对象。<br />
EaseQuadraticInOut 是按二次函数缓动进入并退出的动作。<br />
参考 easeInOutQuad:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.easeQuadraticActionInOut());
```
*/
export function easeQuadraticActionInOut() : any;
/** !#en
Creates the action easing object. <br />
Reference easeIntQuart: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeQuarticActionIn 缓动对象。<br />
EaseQuarticIn 是按四次函数缓动进入的动作。<br />
参考 easeIntQuart:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.easeQuarticActionIn());
```
*/
export function easeQuarticActionIn() : any;
/** !#en
Creates the action easing object. <br />
Reference easeOutQuart: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeQuarticActionOut 缓动对象。<br />
EaseQuarticOut 是按四次函数缓动退出的动作。<br />
参考 easeOutQuart:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.QuarticActionOut());
```
*/
export function easeQuarticActionOut() : any;
/** !#en
Creates the action easing object. <br />
Reference easeInOutQuart: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeQuarticActionInOut 缓动对象。<br />
EaseQuarticInOut 是按四次函数缓动进入并退出的动作。<br />
参考 easeInOutQuart:http://www.zhihu.com/question/21981571/answer/19925418
*/
export function easeQuarticActionInOut() : any;
/** !#en
Creates the action easing object. <br />
Reference easeInQuint: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeQuinticActionIn 缓动对象。<br />
EaseQuinticIn 是按五次函数缓动进的动作。<br />
参考 easeInQuint:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.easeQuinticActionIn());
```
*/
export function easeQuinticActionIn() : any;
/** !#en
Creates the action easing object. <br />
Reference easeOutQuint: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeQuinticActionOut 缓动对象。<br />
EaseQuinticOut 是按五次函数缓动退出的动作
参考 easeOutQuint:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.easeQuadraticActionOut());
```
*/
export function easeQuinticActionOut() : any;
/** !#en
Creates the action easing object. <br />
Reference easeInOutQuint: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeQuinticActionInOut 缓动对象。<br />
EaseQuinticInOut是按五次函数缓动进入并退出的动作。<br />
参考 easeInOutQuint:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.easeQuinticActionInOut());
```
*/
export function easeQuinticActionInOut() : any;
/** !#en
Creates the action easing object. <br />
Reference easeInCirc: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeCircleActionIn 缓动对象。<br />
EaseCircleIn是按圆形曲线缓动进入的动作。<br />
参考 easeInCirc:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.easeCircleActionIn());
```
*/
export function easeCircleActionIn() : any;
/** !#en
Creates the action easing object. <br />
Reference easeOutCirc: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeCircleActionOut 缓动对象。<br />
EaseCircleOut是按圆形曲线缓动退出的动作。<br />
参考 easeOutCirc:http://www.zhihu.com/question/21981571/answer/19925418
*/
export function easeCircleActionOut() : any;
/** !#en
Creates the action easing object. <br />
Reference easeInOutCirc: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeCircleActionInOut 缓动对象。<br />
EaseCircleInOut 是按圆形曲线缓动进入并退出的动作。<br />
参考 easeInOutCirc:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.easeCircleActionInOut());
```
*/
export function easeCircleActionInOut() : any;
/** !#en
Creates the action easing object. <br />
Reference easeInCubic: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeCubicActionIn 缓动对象。<br />
EaseCubicIn 是按三次函数缓动进入的动作。<br />
参考 easeInCubic:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.easeCubicActionIn());
```
*/
export function easeCubicActionIn() : any;
/** !#en
Creates the action easing object. <br />
Reference easeOutCubic: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeCubicActionOut 缓动对象。<br />
EaseCubicOut 是按三次函数缓动退出的动作。<br />
参考 easeOutCubic:http://www.zhihu.com/question/21981571/answer/19925418
@example
```js
//example
action.easing(cc.easeCubicActionOut());
```
*/
export function easeCubicActionOut() : any;
/** !#en
Creates the action easing object. <br />
Reference easeInOutCubic: <br />
http://www.zhihu.com/question/21981571/answer/19925418
!#zh
创建 easeCubicActionInOut 缓动对象。<br />
EaseCubicInOut是按三次函数缓动进入并退出的动作。<br />
参考 easeInOutCubic:http://www.zhihu.com/question/21981571/answer/19925418
*/
export function easeCubicActionInOut() : any;
/** !#en Show the Node.
!#zh 立即显示。
@example
```js
// example
var showAction = cc.show();
```
*/
export function show() : ActionInstant;
/** !#en Hide the node.
!#zh 立即隐藏。
@example
```js
// example
var hideAction = cc.hide();
```
*/
export function hide() : ActionInstant;
/** !#en Toggles the visibility of a node.
!#zh 显隐状态切换。
@example
```js
// example
var toggleVisibilityAction = cc.toggleVisibility();
```
*/
export function toggleVisibility() : ActionInstant;
/** !#en Create a RemoveSelf object with a flag indicate whether the target should be cleaned up while removing.
!#zh 从父节点移除自身。
@example
```js
// example
var removeSelfAction = cc.removeSelf();
```
*/
export function removeSelf(isNeedCleanUp : boolean) : ActionInstant;
/** !#en Create a FlipX action to flip or unflip the target.
!#zh X轴翻转。
@param flip Indicate whether the target should be flipped or not
@example
```js
var flipXAction = cc.flipX(true);
```
*/
export function flipX(flip : boolean) : ActionInstant;
/** !#en Create a FlipY action to flip or unflip the target.
!#zh Y轴翻转。
@example
```js
var flipYAction = cc.flipY(true);
```
*/
export function flipY(flip : boolean) : ActionInstant;
/** !#en Creates a Place action with a position.
!#zh 放置在目标位置。
@example
```js
// example
var placeAction = cc.place(cc.v2(200, 200));
var placeAction = cc.place(200, 200);
```
*/
export function place(pos : Vec2|number, y? : number) : ActionInstant;
/** !#en Creates the action with the callback.
!#zh 执行回调函数。
@param data data for function, it accepts all data types.
@example
```js
// example
// CallFunc without data
var finish = cc.callFunc(this.removeSprite, this);
// CallFunc with data
var finish = cc.callFunc(this.removeFromParentAndCleanup, this._grossini, true);
```
*/
export function callFunc(selector : Function, selectorTarget? : any|void, data? : any|void) : ActionInstant;
/** !#en
Helper constructor to create an array of sequenceable actions
The created action will run actions sequentially, one after another.
!#zh 顺序执行动作,创建的动作将按顺序依次运行。
@example
```js
// example
// create sequence with actions
var seq = cc.sequence(act1, act2);
// create sequence with array
var seq = cc.sequence(actArray);
```
*/
export function sequence(tempArray : any[]|FiniteTimeAction) : ActionInterval;
/** !#en Creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30)
!#zh 重复动作,可以按一定次数重复一个动,如果想永远重复一个动作请使用 repeatForever 动作来完成。
@example
```js
// example
var rep = cc.repeat(cc.sequence(jump2, jump1), 5);
```
*/
export function repeat(action : FiniteTimeAction, times : number) : ActionInterval;
/** !#en Create a acton which repeat forever
!#zh 永远地重复一个动作,有限次数内重复一个动作请使用 repeat 动作。
@example
```js
// example
var repeat = cc.repeatForever(cc.rotateBy(1.0, 360));
```
*/
export function repeatForever(action : FiniteTimeAction) : ActionInterval;
/** !#en Create a spawn action which runs several actions in parallel.
!#zh 同步执行动作,同步执行一组动作。
@example
```js
// example
var action = cc.spawn(cc.jumpBy(2, cc.v2(300, 0), 50, 4), cc.rotateBy(2, 720));
todo:It should be the direct use new
```
*/
export function spawn(tempArray : any[]|FiniteTimeAction) : FiniteTimeAction;
/** !#en
Rotates a Node object to a certain angle by modifying its rotation property. <br/>
The direction will be decided by the shortest angle.
!#zh 旋转到目标角度,通过逐帧修改它的 rotation 属性,旋转方向将由最短的角度决定。
@param duration duration in seconds
@param deltaAngleX deltaAngleX in degrees.
@param deltaAngleY deltaAngleY in degrees.
@example
```js
// example
var rotateTo = cc.rotateTo(2, 61.0);
```
*/
export function rotateTo(duration : number, deltaAngleX : number, deltaAngleY? : number) : ActionInterval;
/** !#en
Rotates a Node object clockwise a number of degrees by modifying its rotation property.
Relative to its properties to modify.
!#zh 旋转指定的角度。
@param duration duration in seconds
@param deltaAngleX deltaAngleX in degrees
@param deltaAngleY deltaAngleY in degrees
@example
```js
// example
var actionBy = cc.rotateBy(2, 360);
```
*/
export function rotateBy(duration : number, deltaAngleX : number, deltaAngleY? : number) : ActionInterval;
/** !#en
Moves a Node object x,y pixels by modifying its position property. <br/>
x and y are relative to the position of the object. <br/>
Several MoveBy actions can be concurrently called, and the resulting <br/>
movement will be the sum of individual movements.
!#zh 移动指定的距离。
@param duration duration in seconds
@example
```js
// example
var actionTo = cc.moveBy(2, cc.v2(windowSize.width - 40, windowSize.height - 40));
```
*/
export function moveBy(duration : number, deltaPos : Vec2|number, deltaY : number) : ActionInterval;
/** !#en
Moves a Node object to the position x,y. x and y are absolute coordinates by modifying its position property. <br/>
Several MoveTo actions can be concurrently called, and the resulting <br/>
movement will be the sum of individual movements.
!#zh 移动到目标位置。
@param duration duration in seconds
@example
```js
// example
var actionBy = cc.moveTo(2, cc.v2(80, 80));
```
*/
export function moveTo(duration : number, position : Vec2, y : number) : ActionInterval;
/** !#en
Create a action which skews a Node object to given angles by modifying its skewX and skewY properties.
Changes to the specified value.
!#zh 偏斜到目标角度。
@param t time in seconds
@example
```js
// example
var actionTo = cc.skewTo(2, 37.2, -37.2);
```
*/
export function skewTo(t : number, sx : number, sy : number) : ActionInterval;
/** !#en
Skews a Node object by skewX and skewY degrees. <br />
Relative to its property modification.
!#zh 偏斜指定的角度。
@param t time in seconds
@param sx sx skew in degrees for X axis
@param sy sy skew in degrees for Y axis
@example
```js
// example
var actionBy = cc.skewBy(2, 0, -90);
```
*/
export function skewBy(t : number, sx : number, sy : number) : ActionInterval;
/** !#en
Moves a Node object simulating a parabolic jump movement by modifying it's position property.
Relative to its movement.
!#zh 用跳跃的方式移动指定的距离。
@example
```js
// example
var actionBy = cc.jumpBy(2, cc.v2(300, 0), 50, 4);
var actionBy = cc.jumpBy(2, 300, 0, 50, 4);
```
*/
export function jumpBy(duration : number, position : Vec2|number, y? : number, height : number, jumps : number) : ActionInterval;
/** !#en
Moves a Node object to a parabolic position simulating a jump movement by modifying its position property. <br />
Jump to the specified location.
!#zh 用跳跃的方式移动到目标位置。
@example
```js
// example
var actionTo = cc.jumpTo(2, cc.v2(300, 300), 50, 4);
var actionTo = cc.jumpTo(2, 300, 300, 50, 4);
```
*/
export function jumpTo(duration : number, position : Vec2|number, y? : number, height : number, jumps : number) : ActionInterval;
/** !#en
An action that moves the target with a cubic Bezier curve by a certain distance.
Relative to its movement.
!#zh 按贝赛尔曲线轨迹移动指定的距离。
@param t time in seconds
@param c Array of points
@example
```js
// example
var bezier = [cc.v2(0, windowSize.height / 2), cc.v2(300, -windowSize.height / 2), cc.v2(300, 100)];
var bezierForward = cc.bezierBy(3, bezier);
```
*/
export function bezierBy(t : number, c : any[]) : ActionInterval;
/** !#en An action that moves the target with a cubic Bezier curve to a destination point.
!#zh 按贝赛尔曲线轨迹移动到目标位置。
@param c array of points
@example
```js
// example
var bezier = [cc.v2(0, windowSize.height / 2), cc.v2(300, -windowSize.height / 2), cc.v2(300, 100)];
var bezierTo = cc.bezierTo(2, bezier);
```
*/
export function bezierTo(t : number, c : any[]) : ActionInterval;
/** !#en Scales a Node object to a zoom factor by modifying it's scale property.
!#zh 将节点大小缩放到指定的倍数。
@param sx scale parameter in X
@param sy scale parameter in Y, if Null equal to sx
@example
```js
// example
// It scales to 0.5 in both X and Y.
var actionTo = cc.scaleTo(2, 0.5);
// It scales to 0.5 in x and 2 in Y
var actionTo = cc.scaleTo(2, 0.5, 2);
```
*/
export function scaleTo(duration : number, sx : number, sy? : number) : ActionInterval;
/** !#en
Scales a Node object a zoom factor by modifying it's scale property.
Relative to its changes.
!#zh 按指定的倍数缩放节点大小。
@param duration duration in seconds
@param sx sx scale parameter in X
@param sy sy scale parameter in Y, if Null equal to sx
@example
```js
// example without sy, it scales by 2 both in X and Y
var actionBy = cc.scaleBy(2, 2);
//example with sy, it scales by 0.25 in X and 4.5 in Y
var actionBy2 = cc.scaleBy(2, 0.25, 4.5);
```
*/
export function scaleBy(duration : number, sx : number, sy? : number|void) : ActionInterval;
/** !#en Blinks a Node object by modifying it's visible property.
!#zh 闪烁(基于透明度)。
@param duration duration in seconds
@param blinks blinks in times
@example
```js
// example
var action = cc.blink(2, 10);
```
*/
export function blink(duration : number, blinks : number) : ActionInterval;
/** !#en
Fades an object that implements the cc.RGBAProtocol protocol.
It modifies the opacity from the current value to a custom one.
!#zh 修改透明度到指定值。
@param opacity 0-255, 0 is transparent
@example
```js
// example
var action = cc.fadeTo(1.0, 0);
```
*/
export function fadeTo(duration : number, opacity : number) : ActionInterval;
/** !#en Fades In an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 0 to 255.
!#zh 渐显效果。
@param duration duration in seconds
@example
```js
//example
var action = cc.fadeIn(1.0);
```
*/
export function fadeIn(duration : number) : ActionInterval;
/** !#en Fades Out an object that implements the cc.RGBAProtocol protocol. It modifies the opacity from 255 to 0.
!#zh 渐隐效果。
@param d duration in seconds
@example
```js
// example
var action = cc.fadeOut(1.0);
```
*/
export function fadeOut(d : number) : ActionInterval;
/** !#en Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one.
!#zh 修改颜色到指定值。
@param red 0-255
@param green 0-255
@param blue 0-255
@example
```js
// example
var action = cc.tintTo(2, 255, 0, 255);
```
*/
export function tintTo(duration : number, red : number, green : number, blue : number) : ActionInterval;
/** !#en
Tints a Node that implements the cc.NodeRGB protocol from current tint to a custom one.
Relative to their own color change.
!#zh 按照指定的增量修改颜色。
@param duration duration in seconds
@example
```js
// example