-
Notifications
You must be signed in to change notification settings - Fork 2
/
tween-config.js
119 lines (100 loc) · 3.09 KB
/
tween-config.js
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
/** @enum {number} */
export const Easing = {
Linear: 0,
Quadratic: 1,
Cubic: 2,
Quartic: 3,
Quintic: 4,
Sinusoidal: 5,
Exponential: 6,
Circular: 7,
Elastic: 8,
Back: 9,
Bounce: 1
}
/** @enum {number} */
export const EasingType = {
In: 0,
Out: 1,
InOut: 2
}
/** @interface */
export class TweenOptions {
/**
* Play tween immediately.
*/
autoPlay = false
/**
* Play tween on the specified event name. This event must be fired on the global application object (e.g. this.app.fire(\'eventname\');).
* @type {string}
*/
event = ''
/**
* The path from the entity to the property. e.g. \'light.color\', \'camera.fov\' or \'script.vehicle.speed\'.
* @type {string}
*/
path
/**
* @type {pc.Vec4}
*/
start
/**
* @type {pc.Vec4}
*/
end
/**
* The easing functions: Linear, Quadratic, Cubic, Quartic, Quintic, Sinusoidal, Exponential, Circular, Elastic, Back and Bounce.
* @type {Easing}
*/
easingFunction = 0
/**
* Whether to ease in, easy out or ease in and then out using the specified easing function. Note that for a Linear easing function, the easing type is ignored.
* @type {EasingType}
*/
easingType = 0
/**
* Time to wait in milliseconds after receiving the trigger event before executing the tween. Defaults to 0.
*/
delay = 0
/**
* Time to execute the tween in milliseconds. Defaults to 1000.
*/
duration = 1000
/**
* The number of times the tween should be repeated after the initial playback. -1 will repeat forever. Defaults to 0.
*/
repeat = 0
/**
* Time to wait in milliseconds before executing each repeat of the tween. Defaults to 0.
*/
repeatDelay = 0
/**
* This function only has effect if used along with repeat. When active, the behaviour of the tween will be like a yoyo, i.e. it will bounce to and from the start and end values, instead of just repeating the same sequence from the beginning. Defaults to false.
*/
yoyo = false
/**
* Executed right before the tween starts animating, after any delay time specified by the delay method. This will be executed only once per tween, i.e. it will not be run when the tween is repeated via repeat(). It is great for synchronising to other events or triggering actions you want to happen when a tween starts.
* @type {string}
*/
startEvent
/**
* Executed when a tween is explicitly stopped via stop(), but not when it is completed normally.
* @type {string}
*/
stopEvent
/**
* Executed each time the tween is updated, after the values have been actually updated.
* @type {string}
*/
updateEvent
/**
* Executed when a tween is finished normally (i.e. not stopped).
* @type {string}
*/
completeEvent
/**
* Executed whenever a tween has just finished one repetition and will begin another.
* @type {string}
*/
repeatEvent
}