forked from zhitaocai/CocosCreator-EaseAction-Plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
creator.extension.d.ts
50 lines (45 loc) · 2.01 KB
/
creator.extension.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
declare namespace cc {
/** cc.tween方法 */
function tween(target?: cc.Node): NewTween;
/** ease字符串,参考:https://docs.cocos.com/creator/api/zh/editor/share/easing.html */
type tweenEasing = "linear" | "fade" |
"quadIn" | "quadOut" | "quadInOut" | "quadOutIn" |
"cubicIn" | "cubicOut" | "cubicInOut" | "cubicOutIn" |
"quartIn" | "quartOut" | "quartInOut" | "quartOutIn" |
"quintIn" | "quintOut" | "quintInOut" | "quintOutIn" |
"sineIn" | "sineOut" | "sineInOut" | "sineOutIn" |
"expoIn" | "expoOut" | "expoInOut" | "expoOutIn" |
"circIn" | "circOut" | "circInOut" | "circOutIn" |
"elasticIn" | "elasticOut" | "elasticInOut" | "elasticOutIn" |
"backIn" | "backOut" | "backInOut" | "backOutIn" |
"bounceIn" | "bounceOut" | "bounceInOut" | "bounceOutIn";
/** 可选属性,参考:cc.Node */
type tweenProps = Partial<cc.Node>;
/** 可选参数 */
type tweenOpts = {
progress?: Function;
easing?: Function | tweenEasing;
}
/** cc.Tween,为了区分开来使用cc.NewTween */
class NewTween {
then(other: Action | NewTween): NewTween;
target(target: any): NewTween;
start(): NewTween;
stop(): NewTween;
clone(target?: any): NewTween;
to(duration: number, props?: tweenProps, opts?: tweenOpts): NewTween;
by(duration: number, props?: tweenProps, opts?: tweenOpts): NewTween;
set(props: tweenProps): NewTween;
delay(duration: number): NewTween;
call(callback: Function): NewTween;
hide(): NewTween;
show(): NewTween;
removeSelf(): NewTween;
sequence(...actions: (Action | NewTween)[]): NewTween;
parallel(...actions: (Action | NewTween)[]): NewTween;
repeat(repeatTimes: number, action?: Action | NewTween): NewTween;
repeatForever(action?: Action | NewTween): NewTween;
reverseTime(action?: Action | NewTween): NewTween;
tween(target?: any): NewTween;
}
}