@tweenjs/tween.js 19.0.0 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -49
- package/dist/tween.amd.js +70 -71
- package/dist/tween.cjs.js +68 -69
- package/dist/tween.d.ts +44 -32
- package/dist/tween.esm.js +68 -70
- package/dist/tween.umd.js +70 -71
- package/package.json +7 -8
package/README.md
CHANGED
|
@@ -100,48 +100,108 @@ const TWEEN = require('@tweenjs/tween.js')
|
|
|
100
100
|
<table>
|
|
101
101
|
<tr>
|
|
102
102
|
<td>
|
|
103
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
104
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
103
|
+
<a href="http://tweenjs.github.io/tween.js/examples/00_hello_world.html">
|
|
104
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/00_hello_world.png" alt="hello world" />
|
|
105
105
|
</a>
|
|
106
106
|
</td>
|
|
107
107
|
<td>
|
|
108
|
-
|
|
109
|
-
(<a href="examples/
|
|
108
|
+
hello world<br />
|
|
109
|
+
(<a href="examples/00_hello_world.html">source</a>)
|
|
110
110
|
</td>
|
|
111
111
|
<td>
|
|
112
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
113
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
112
|
+
<a href="http://tweenjs.github.io/tween.js/examples/01_bars.html">
|
|
113
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/01_bars.png" alt="Bars" />
|
|
114
114
|
</a>
|
|
115
115
|
</td>
|
|
116
116
|
<td>
|
|
117
|
-
|
|
118
|
-
(<a href="examples/
|
|
117
|
+
Bars<br />
|
|
118
|
+
(<a href="examples/01_bars.html">source</a>)
|
|
119
|
+
</td>
|
|
120
|
+
<tr>
|
|
121
|
+
</tr>
|
|
122
|
+
<td>
|
|
123
|
+
<a href="http://tweenjs.github.io/tween.js/examples/02_black_and_red.html">
|
|
124
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/02_black_and_red.png" alt="Black and red" />
|
|
125
|
+
</a>
|
|
126
|
+
</td>
|
|
127
|
+
<td>
|
|
128
|
+
Black and red<br />
|
|
129
|
+
(<a href="examples/02_black_and_red.html">source</a>)
|
|
130
|
+
</td>
|
|
131
|
+
<td>
|
|
132
|
+
<a href="http://tweenjs.github.io/tween.js/examples/03_graphs.html">
|
|
133
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/03_graphs.png" alt="Graphs" />
|
|
134
|
+
</a>
|
|
135
|
+
</td>
|
|
136
|
+
<td>
|
|
137
|
+
Graphs<br />
|
|
138
|
+
(<a href="examples/03_graphs.html">source</a>)
|
|
119
139
|
</td>
|
|
120
140
|
</tr>
|
|
121
141
|
<tr>
|
|
122
142
|
<td>
|
|
123
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
124
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
143
|
+
<a href="http://tweenjs.github.io/tween.js/examples/04_simplest.html">
|
|
144
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/04_simplest.png" alt="Simplest possible example" />
|
|
125
145
|
</a>
|
|
126
146
|
</td>
|
|
127
147
|
<td>
|
|
128
|
-
|
|
129
|
-
(<a href="examples/
|
|
148
|
+
Simplest possible example<br />
|
|
149
|
+
(<a href="examples/04_simplest.html">source</a>)
|
|
130
150
|
</td>
|
|
131
151
|
<td>
|
|
132
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
133
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
152
|
+
<a href="http://tweenjs.github.io/tween.js/examples/05_video_and_time.html">
|
|
153
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/06_video_and_time.png" alt="Video and time" />
|
|
134
154
|
</a>
|
|
135
155
|
</td>
|
|
136
156
|
<td>
|
|
137
|
-
|
|
138
|
-
(<a href="examples/
|
|
157
|
+
Video and time<br />
|
|
158
|
+
(<a href="examples/05_video_and_time.html">source</a>)
|
|
159
|
+
</td>
|
|
160
|
+
</tr>
|
|
161
|
+
<tr>
|
|
162
|
+
<td>
|
|
163
|
+
<a href="http://tweenjs.github.io/tween.js/examples/06_array_interpolation.html">
|
|
164
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/03_graphs.png" alt="Array interpolation" />
|
|
165
|
+
</a>
|
|
166
|
+
</td>
|
|
167
|
+
<td>
|
|
168
|
+
Array interpolation<br />
|
|
169
|
+
(<a href="examples/06_array_interpolation.html">source</a>)
|
|
170
|
+
</td>
|
|
171
|
+
<td>
|
|
172
|
+
<a href="http://tweenjs.github.io/tween.js/examples/07_dynamic_to.html">
|
|
173
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/07_dynamic_to.png" alt="Dynamic to, object" />
|
|
174
|
+
</a>
|
|
175
|
+
</td>
|
|
176
|
+
<td>
|
|
177
|
+
Dynamic to, object<br />
|
|
178
|
+
(<a href="examples/07_dynamic_to.html">source</a>)
|
|
179
|
+
</td>
|
|
180
|
+
</tr>
|
|
181
|
+
<tr>
|
|
182
|
+
<td>
|
|
183
|
+
<a href="http://tweenjs.github.io/tween.js/examples/07a_dynamic_to_two_array_values.html">
|
|
184
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/07a_dynamic_to.png" alt="Dynamic to, interpolation array" />
|
|
185
|
+
</a>
|
|
186
|
+
</td>
|
|
187
|
+
<td>
|
|
188
|
+
Dynamic to, interpolation array<br />
|
|
189
|
+
(<a href="examples/07a_dynamic_to_two_array_values.html">source</a>)
|
|
190
|
+
</td>
|
|
191
|
+
<td>
|
|
192
|
+
<a href="http://tweenjs.github.io/tween.js/examples/07b_dynamic_to_an_array_of_values.html">
|
|
193
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/07b_dynamic_to.png" alt="Dynamic to, large interpolation array" />
|
|
194
|
+
</a>
|
|
195
|
+
</td>
|
|
196
|
+
<td>
|
|
197
|
+
Dynamic to, large interpolation array<br />
|
|
198
|
+
(<a href="examples/07b_dynamic_to_an_array_of_values.html">source</a>)
|
|
139
199
|
</td>
|
|
140
200
|
</tr>
|
|
141
201
|
<tr>
|
|
142
202
|
<td>
|
|
143
203
|
<a href="http://tweenjs.github.io/tween.js/examples/08_repeat.html">
|
|
144
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/08_repeat.png" alt="Repeat" />
|
|
204
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/08_repeat.png" alt="Repeat" />
|
|
145
205
|
</a>
|
|
146
206
|
</td>
|
|
147
207
|
<td>
|
|
@@ -149,84 +209,84 @@ const TWEEN = require('@tweenjs/tween.js')
|
|
|
149
209
|
(<a href="examples/08_repeat.html">source</a>)
|
|
150
210
|
</td>
|
|
151
211
|
<td>
|
|
152
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
153
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
212
|
+
<a href="http://tweenjs.github.io/tween.js/examples/09_relative_values.html">
|
|
213
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/09_relative.png" alt="Relative values" />
|
|
154
214
|
</a>
|
|
155
215
|
</td>
|
|
156
216
|
<td>
|
|
157
|
-
|
|
158
|
-
(<a href="examples/
|
|
217
|
+
Relative values<br />
|
|
218
|
+
(<a href="examples/09_relative_values.html">source</a>)
|
|
159
219
|
</td>
|
|
160
220
|
</tr>
|
|
161
221
|
<tr>
|
|
162
222
|
<td>
|
|
163
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
164
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
223
|
+
<a href="http://tweenjs.github.io/tween.js/examples/10_yoyo.html">
|
|
224
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/10_yoyo.png" alt="Yoyo" />
|
|
165
225
|
</a>
|
|
166
226
|
</td>
|
|
167
227
|
<td>
|
|
168
|
-
|
|
169
|
-
(<a href="examples/
|
|
228
|
+
Yoyo<br />
|
|
229
|
+
(<a href="examples/10_yoyo.html">source</a>)
|
|
170
230
|
</td>
|
|
171
231
|
<td>
|
|
172
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
173
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
232
|
+
<a href="http://tweenjs.github.io/tween.js/examples/11_stop_all_chained_tweens.html">
|
|
233
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/11_stop_all_chained_tweens.png" alt="Stop all chained tweens" />
|
|
174
234
|
</a>
|
|
175
235
|
</td>
|
|
176
236
|
<td>
|
|
177
|
-
|
|
178
|
-
(<a href="examples/
|
|
237
|
+
Stop all chained tweens<br />
|
|
238
|
+
(<a href="examples/11_stop_all_chained_tweens.html">source</a>)
|
|
179
239
|
</td>
|
|
180
240
|
</tr>
|
|
181
241
|
<tr>
|
|
182
242
|
<td>
|
|
183
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
184
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
243
|
+
<a href="http://tweenjs.github.io/tween.js/examples/12_graphs_custom_functions.html">
|
|
244
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/03_graphs.png" alt="Custom functions" />
|
|
185
245
|
</a>
|
|
186
246
|
</td>
|
|
187
247
|
<td>
|
|
188
|
-
|
|
189
|
-
(<a href="examples/
|
|
248
|
+
Custom functions<br />
|
|
249
|
+
(<a href="examples/12_graphs_custom_functions.html">source</a>)
|
|
190
250
|
</td>
|
|
191
251
|
<td>
|
|
192
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
193
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
252
|
+
<a href="http://tweenjs.github.io/tween.js/examples/13_relative_start_time.html">
|
|
253
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/13_relative_start_time.png" alt="Relative start time" />
|
|
194
254
|
</a>
|
|
195
255
|
</td>
|
|
196
256
|
<td>
|
|
197
|
-
|
|
198
|
-
(<a href="examples/
|
|
257
|
+
Relative start time<br />
|
|
258
|
+
(<a href="examples/13_relative_start_time.html">source</a>)
|
|
199
259
|
</td>
|
|
200
260
|
</tr>
|
|
201
261
|
<tr>
|
|
202
262
|
<td>
|
|
203
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
204
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
263
|
+
<a href="http://tweenjs.github.io/tween.js/examples/14_pause_tween.html">
|
|
264
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/14_pause_tween.png" alt="Pause tween" />
|
|
205
265
|
</a>
|
|
206
266
|
</td>
|
|
207
267
|
<td>
|
|
208
|
-
|
|
209
|
-
(<a href="examples/
|
|
268
|
+
Pause tween<br />
|
|
269
|
+
(<a href="examples/14_pause_tween.html">source</a>)
|
|
210
270
|
</td>
|
|
211
271
|
<td>
|
|
212
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
213
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
272
|
+
<a href="http://tweenjs.github.io/tween.js/examples/15_complex_properties.html">
|
|
273
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/15_complex_properties.png" alt="Complex properties" />
|
|
214
274
|
</a>
|
|
215
275
|
</td>
|
|
216
276
|
<td>
|
|
217
|
-
|
|
218
|
-
(<a href="examples/
|
|
277
|
+
Complex properties<br />
|
|
278
|
+
(<a href="examples/15_complex_properties.html">source</a>)
|
|
219
279
|
</td>
|
|
220
280
|
</tr>
|
|
221
281
|
<tr>
|
|
222
282
|
<td>
|
|
223
|
-
<a href="http://tweenjs.github.io/tween.js/examples/
|
|
224
|
-
<img src="https://tweenjs.github.io/tween.js/assets/examples/
|
|
283
|
+
<a href="http://tweenjs.github.io/tween.js/examples/16_animate_an_array_of_values.html">
|
|
284
|
+
<img width="100" height="50" src="https://tweenjs.github.io/tween.js/assets/examples/16_animate_an_array_of_values.png" alt="Animate an array of values" />
|
|
225
285
|
</a>
|
|
226
286
|
</td>
|
|
227
287
|
<td>
|
|
228
|
-
|
|
229
|
-
(<a href="examples/
|
|
288
|
+
Animate an array of values<br />
|
|
289
|
+
(<a href="examples/16_animate_an_array_of_values.html">source</a>)
|
|
230
290
|
</td>
|
|
231
291
|
</tr>
|
|
232
292
|
</table>
|
package/dist/tween.amd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(['exports'], function (exports) { 'use strict';
|
|
1
|
+
define(['exports'], (function (exports) { 'use strict';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The Ease class provides a collection of easing functions for use with tween.js.
|
|
@@ -215,37 +215,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
215
215
|
},
|
|
216
216
|
});
|
|
217
217
|
|
|
218
|
-
var now;
|
|
219
|
-
// Include a performance.now polyfill.
|
|
220
|
-
// In node.js, use process.hrtime.
|
|
221
|
-
// eslint-disable-next-line
|
|
222
|
-
// @ts-ignore
|
|
223
|
-
if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) {
|
|
224
|
-
now = function () {
|
|
225
|
-
// eslint-disable-next-line
|
|
226
|
-
// @ts-ignore
|
|
227
|
-
var time = process.hrtime();
|
|
228
|
-
// Convert [seconds, nanoseconds] to milliseconds.
|
|
229
|
-
return time[0] * 1000 + time[1] / 1000000;
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
// In a browser, use self.performance.now if it is available.
|
|
233
|
-
else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) {
|
|
234
|
-
// This must be bound, because directly assigning this function
|
|
235
|
-
// leads to an invocation exception in Chrome.
|
|
236
|
-
now = self.performance.now.bind(self.performance);
|
|
237
|
-
}
|
|
238
|
-
// Use Date.now if it is available.
|
|
239
|
-
else if (Date.now !== undefined) {
|
|
240
|
-
now = Date.now;
|
|
241
|
-
}
|
|
242
|
-
// Otherwise, use 'new Date().getTime()'.
|
|
243
|
-
else {
|
|
244
|
-
now = function () {
|
|
245
|
-
return new Date().getTime();
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
var now$1 = now;
|
|
218
|
+
var now = function () { return performance.now(); };
|
|
249
219
|
|
|
250
220
|
/**
|
|
251
221
|
* Controlling groups of tweens
|
|
@@ -276,7 +246,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
276
246
|
delete this._tweensAddedDuringUpdate[tween.getId()];
|
|
277
247
|
};
|
|
278
248
|
Group.prototype.update = function (time, preserve) {
|
|
279
|
-
if (time === void 0) { time = now
|
|
249
|
+
if (time === void 0) { time = now(); }
|
|
280
250
|
if (preserve === void 0) { preserve = false; }
|
|
281
251
|
var tweenIds = Object.keys(this._tweens);
|
|
282
252
|
if (tweenIds.length === 0) {
|
|
@@ -417,6 +387,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
417
387
|
this._valuesEnd = {};
|
|
418
388
|
this._valuesStartRepeat = {};
|
|
419
389
|
this._duration = 1000;
|
|
390
|
+
this._isDynamic = false;
|
|
420
391
|
this._initialRepeat = 0;
|
|
421
392
|
this._repeat = 0;
|
|
422
393
|
this._yoyo = false;
|
|
@@ -432,6 +403,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
432
403
|
this._onEveryStartCallbackFired = false;
|
|
433
404
|
this._id = Sequence.nextId();
|
|
434
405
|
this._isChainStopped = false;
|
|
406
|
+
this._propertiesAreSetUp = false;
|
|
435
407
|
this._goToEnd = false;
|
|
436
408
|
}
|
|
437
409
|
Tween.prototype.getId = function () {
|
|
@@ -443,24 +415,27 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
443
415
|
Tween.prototype.isPaused = function () {
|
|
444
416
|
return this._isPaused;
|
|
445
417
|
};
|
|
446
|
-
Tween.prototype.to = function (
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
this.
|
|
452
|
-
|
|
453
|
-
this._duration = duration;
|
|
454
|
-
}
|
|
418
|
+
Tween.prototype.to = function (target, duration) {
|
|
419
|
+
if (duration === void 0) { duration = 1000; }
|
|
420
|
+
if (this._isPlaying)
|
|
421
|
+
throw new Error('Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.');
|
|
422
|
+
this._valuesEnd = target;
|
|
423
|
+
this._propertiesAreSetUp = false;
|
|
424
|
+
this._duration = duration;
|
|
455
425
|
return this;
|
|
456
426
|
};
|
|
457
|
-
Tween.prototype.duration = function (
|
|
458
|
-
if (
|
|
459
|
-
this._duration =
|
|
427
|
+
Tween.prototype.duration = function (duration) {
|
|
428
|
+
if (duration === void 0) { duration = 1000; }
|
|
429
|
+
this._duration = duration;
|
|
430
|
+
return this;
|
|
431
|
+
};
|
|
432
|
+
Tween.prototype.dynamic = function (dynamic) {
|
|
433
|
+
if (dynamic === void 0) { dynamic = false; }
|
|
434
|
+
this._isDynamic = dynamic;
|
|
460
435
|
return this;
|
|
461
436
|
};
|
|
462
437
|
Tween.prototype.start = function (time, overrideStartingValues) {
|
|
463
|
-
if (time === void 0) { time = now
|
|
438
|
+
if (time === void 0) { time = now(); }
|
|
464
439
|
if (overrideStartingValues === void 0) { overrideStartingValues = false; }
|
|
465
440
|
if (this._isPlaying) {
|
|
466
441
|
return this;
|
|
@@ -484,7 +459,17 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
484
459
|
this._isChainStopped = false;
|
|
485
460
|
this._startTime = time;
|
|
486
461
|
this._startTime += this._delayTime;
|
|
487
|
-
|
|
462
|
+
if (!this._propertiesAreSetUp || overrideStartingValues) {
|
|
463
|
+
this._propertiesAreSetUp = true;
|
|
464
|
+
// If dynamic is not enabled, clone the end values instead of using the passed-in end values.
|
|
465
|
+
if (!this._isDynamic) {
|
|
466
|
+
var tmp = {};
|
|
467
|
+
for (var prop in this._valuesEnd)
|
|
468
|
+
tmp[prop] = this._valuesEnd[prop];
|
|
469
|
+
this._valuesEnd = tmp;
|
|
470
|
+
}
|
|
471
|
+
this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat, overrideStartingValues);
|
|
472
|
+
}
|
|
488
473
|
return this;
|
|
489
474
|
};
|
|
490
475
|
Tween.prototype.startFromCurrentValues = function (time) {
|
|
@@ -507,26 +492,42 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
507
492
|
if (endValues.length === 0) {
|
|
508
493
|
continue;
|
|
509
494
|
}
|
|
510
|
-
//
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
495
|
+
// Handle an array of relative values.
|
|
496
|
+
// Creates a local copy of the Array with the start value at the front
|
|
497
|
+
var temp = [startValue];
|
|
498
|
+
for (var i = 0, l = endValues.length; i < l; i += 1) {
|
|
499
|
+
var value = this._handleRelativeValue(startValue, endValues[i]);
|
|
500
|
+
if (isNaN(value)) {
|
|
501
|
+
isInterpolationList = false;
|
|
502
|
+
console.warn('Found invalid interpolation list. Skipping.');
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
505
|
+
temp.push(value);
|
|
506
|
+
}
|
|
507
|
+
if (isInterpolationList) {
|
|
508
|
+
// if (_valuesStart[property] === undefined) { // handle end values only the first time. NOT NEEDED? setupProperties is now guarded by _propertiesAreSetUp.
|
|
509
|
+
_valuesEnd[property] = temp;
|
|
510
|
+
// }
|
|
515
511
|
}
|
|
516
512
|
}
|
|
517
513
|
// handle the deepness of the values
|
|
518
514
|
if ((propType === 'object' || startValueIsArray) && startValue && !isInterpolationList) {
|
|
519
515
|
_valuesStart[property] = startValueIsArray ? [] : {};
|
|
520
|
-
|
|
521
|
-
for (var prop in
|
|
522
|
-
|
|
523
|
-
// @ts-ignore FIXME?
|
|
524
|
-
_valuesStart[property][prop] = startValue[prop];
|
|
516
|
+
var nestedObject = startValue;
|
|
517
|
+
for (var prop in nestedObject) {
|
|
518
|
+
_valuesStart[property][prop] = nestedObject[prop];
|
|
525
519
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
520
|
+
// TODO? repeat nested values? And yoyo? And array values?
|
|
521
|
+
_valuesStartRepeat[property] = startValueIsArray ? [] : {};
|
|
522
|
+
var endValues = _valuesEnd[property];
|
|
523
|
+
// If dynamic is not enabled, clone the end values instead of using the passed-in end values.
|
|
524
|
+
if (!this._isDynamic) {
|
|
525
|
+
var tmp = {};
|
|
526
|
+
for (var prop in endValues)
|
|
527
|
+
tmp[prop] = endValues[prop];
|
|
528
|
+
_valuesEnd[property] = endValues = tmp;
|
|
529
|
+
}
|
|
530
|
+
this._setupProperties(nestedObject, _valuesStart[property], endValues, _valuesStartRepeat[property], overrideStartingValues);
|
|
530
531
|
}
|
|
531
532
|
else {
|
|
532
533
|
// Save the starting value, but only once unless override is requested.
|
|
@@ -572,7 +573,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
572
573
|
return this;
|
|
573
574
|
};
|
|
574
575
|
Tween.prototype.pause = function (time) {
|
|
575
|
-
if (time === void 0) { time = now
|
|
576
|
+
if (time === void 0) { time = now(); }
|
|
576
577
|
if (this._isPaused || !this._isPlaying) {
|
|
577
578
|
return this;
|
|
578
579
|
}
|
|
@@ -583,7 +584,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
583
584
|
return this;
|
|
584
585
|
};
|
|
585
586
|
Tween.prototype.resume = function (time) {
|
|
586
|
-
if (time === void 0) { time = now
|
|
587
|
+
if (time === void 0) { time = now(); }
|
|
587
588
|
if (!this._isPaused || !this._isPlaying) {
|
|
588
589
|
return this;
|
|
589
590
|
}
|
|
@@ -674,7 +675,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
674
675
|
* it is still playing, just paused).
|
|
675
676
|
*/
|
|
676
677
|
Tween.prototype.update = function (time, autoStart) {
|
|
677
|
-
if (time === void 0) { time = now
|
|
678
|
+
if (time === void 0) { time = now(); }
|
|
678
679
|
if (autoStart === void 0) { autoStart = true; }
|
|
679
680
|
if (this._isPaused)
|
|
680
681
|
return true;
|
|
@@ -797,9 +798,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
797
798
|
if (end.charAt(0) === '+' || end.charAt(0) === '-') {
|
|
798
799
|
return start + parseFloat(end);
|
|
799
800
|
}
|
|
800
|
-
|
|
801
|
-
return parseFloat(end);
|
|
802
|
-
}
|
|
801
|
+
return parseFloat(end);
|
|
803
802
|
};
|
|
804
803
|
Tween.prototype._swapEndStartRepeatValues = function (property) {
|
|
805
804
|
var tmp = this._valuesStartRepeat[property];
|
|
@@ -815,7 +814,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
815
814
|
return Tween;
|
|
816
815
|
}());
|
|
817
816
|
|
|
818
|
-
var VERSION = '
|
|
817
|
+
var VERSION = '20.0.0';
|
|
819
818
|
|
|
820
819
|
/**
|
|
821
820
|
* Tween.js - Licensed under the MIT license
|
|
@@ -846,7 +845,7 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
846
845
|
Easing: Easing,
|
|
847
846
|
Group: Group,
|
|
848
847
|
Interpolation: Interpolation,
|
|
849
|
-
now: now
|
|
848
|
+
now: now,
|
|
850
849
|
Sequence: Sequence,
|
|
851
850
|
nextId: nextId,
|
|
852
851
|
Tween: Tween,
|
|
@@ -868,11 +867,11 @@ define(['exports'], function (exports) { 'use strict';
|
|
|
868
867
|
exports.default = exports$1;
|
|
869
868
|
exports.getAll = getAll;
|
|
870
869
|
exports.nextId = nextId;
|
|
871
|
-
exports.now = now
|
|
870
|
+
exports.now = now;
|
|
872
871
|
exports.remove = remove;
|
|
873
872
|
exports.removeAll = removeAll;
|
|
874
873
|
exports.update = update;
|
|
875
874
|
|
|
876
875
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
877
876
|
|
|
878
|
-
});
|
|
877
|
+
}));
|