forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTweenData.js
More file actions
76 lines (55 loc) · 1.98 KB
/
Copy pathTweenData.js
File metadata and controls
76 lines (55 loc) · 1.98 KB
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
var TweenData = function (target, key, value, ease, delay, duration, yoyo, hold, repeat, repeatDelay, startAt)
{
return {
// The target to tween
target: target,
// The property of the target to tween
key: key,
// A function to call when starting the tween, populates the 'start' and 'end' values
value: value,
// The ease function this tween uses.
ease: ease,
// Duration of the tween in ms/frames, excludes time for yoyo or repeats.
duration: 0,
// The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo)
totalDuration: 0,
// Time in ms/frames before tween will start.
delay: 0,
// Cause the tween to return back to its start value after hold has expired.
yoyo: yoyo,
// Time in ms/frames the tween will pause before running the yoyo or starting a repeat.
hold: 0,
// Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice.
repeat: 0,
// Time in ms/frames before the repeat will start.
repeatDelay: 0,
// Changes the property to be this value before starting the tween.
startAt: startAt,
// Between 0 and 1 showing completion of this TweenData.
progress: 0,
// Delta counter.
elapsed: 0,
// How many repeats are left to run?
repeatCounter: 0,
// Ease Value Data:
start: 0,
current: 0,
end: 0,
startCache: 0,
endCache: 0,
// Time Durations
t1: 0,
t2: 0,
// LoadValue generation functions
gen: {
delay: delay,
duration: duration,
hold: hold,
repeat: repeat,
repeatDelay: repeatDelay
},
// TWEEN_CONST.CREATED
state: 0
};
};
module.exports = TweenData;