@vpmedia/phaser 1.11.0 → 1.12.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 +1 -1
- package/package.json +8 -5
- package/src/phaser/core/animation.js +9 -6
- package/src/phaser/core/animation_manager.js +14 -4
- package/src/phaser/core/animation_parser.js +24 -3
- package/src/phaser/core/array_set.js +1 -3
- package/src/phaser/core/cache.js +6 -6
- package/src/phaser/core/device.js +0 -2
- package/src/phaser/core/device_util.js +21 -6
- package/src/phaser/core/dom.js +34 -25
- package/src/phaser/core/event_manager.js +45 -17
- package/src/phaser/core/factory.js +26 -4
- package/src/phaser/core/frame.js +0 -2
- package/src/phaser/core/frame_data.js +0 -2
- package/src/phaser/core/game.js +8 -6
- package/src/phaser/core/input.js +17 -9
- package/src/phaser/core/input_handler.js +100 -26
- package/src/phaser/core/input_mouse.js +10 -14
- package/src/phaser/core/input_mspointer.js +10 -9
- package/src/phaser/core/input_pointer.js +58 -17
- package/src/phaser/core/input_touch.js +6 -8
- package/src/phaser/core/loader.js +168 -51
- package/src/phaser/core/loader_parser.js +4 -1
- package/src/phaser/core/raf.js +0 -2
- package/src/phaser/core/scale_manager.js +69 -25
- package/src/phaser/core/scene.js +0 -2
- package/src/phaser/core/scene_manager.js +6 -3
- package/src/phaser/core/signal.js +15 -8
- package/src/phaser/core/signal_binding.js +10 -5
- package/src/phaser/core/sound.js +20 -11
- package/src/phaser/core/sound_manager.js +56 -20
- package/src/phaser/core/sound_sprite.js +32 -32
- package/src/phaser/core/stage.js +0 -3
- package/src/phaser/core/time.js +0 -2
- package/src/phaser/core/timer.js +24 -7
- package/src/phaser/core/timer_event.js +0 -2
- package/src/phaser/core/tween.js +32 -8
- package/src/phaser/core/tween_data.js +15 -7
- package/src/phaser/core/tween_easing.js +24 -20
- package/src/phaser/core/tween_manager.js +31 -13
- package/src/phaser/core/world.js +0 -2
- package/src/phaser/display/bitmap_text.js +8 -9
- package/src/phaser/display/button.js +16 -4
- package/src/phaser/display/canvas/buffer.js +0 -2
- package/src/phaser/display/canvas/graphics.js +21 -9
- package/src/phaser/display/canvas/masker.js +1 -1
- package/src/phaser/display/canvas/renderer.js +39 -19
- package/src/phaser/display/canvas/tinter.js +43 -6
- package/src/phaser/display/canvas/util.js +1 -1
- package/src/phaser/display/display_object.js +33 -19
- package/src/phaser/display/graphics.js +52 -27
- package/src/phaser/display/graphics_data.js +0 -2
- package/src/phaser/display/graphics_data_util.js +9 -1
- package/src/phaser/display/group.js +1 -4
- package/src/phaser/display/image.js +2 -4
- package/src/phaser/display/sprite_batch.js +0 -2
- package/src/phaser/display/sprite_util.js +46 -11
- package/src/phaser/display/text.js +77 -26
- package/src/phaser/display/webgl/abstract_filter.js +0 -2
- package/src/phaser/display/webgl/base_texture.js +5 -3
- package/src/phaser/display/webgl/blend_manager.js +0 -2
- package/src/phaser/display/webgl/earcut.js +63 -22
- package/src/phaser/display/webgl/earcut_node.js +0 -2
- package/src/phaser/display/webgl/fast_sprite_batch.js +47 -46
- package/src/phaser/display/webgl/filter_manager.js +0 -2
- package/src/phaser/display/webgl/filter_texture.js +16 -5
- package/src/phaser/display/webgl/graphics.js +38 -16
- package/src/phaser/display/webgl/graphics_data.js +0 -2
- package/src/phaser/display/webgl/mask_manager.js +10 -2
- package/src/phaser/display/webgl/render_texture.js +14 -5
- package/src/phaser/display/webgl/renderer.js +39 -7
- package/src/phaser/display/webgl/shader/complex.js +0 -2
- package/src/phaser/display/webgl/shader/fast.js +8 -3
- package/src/phaser/display/webgl/shader/normal.js +42 -14
- package/src/phaser/display/webgl/shader/primitive.js +0 -2
- package/src/phaser/display/webgl/shader/strip.js +0 -2
- package/src/phaser/display/webgl/shader_manager.js +0 -2
- package/src/phaser/display/webgl/sprite_batch.js +13 -14
- package/src/phaser/display/webgl/stencil_manager.js +18 -20
- package/src/phaser/display/webgl/texture.js +10 -7
- package/src/phaser/display/webgl/util.js +1 -2
- package/src/phaser/geom/circle.js +15 -7
- package/src/phaser/geom/ellipse.js +13 -6
- package/src/phaser/geom/line.js +19 -10
- package/src/phaser/geom/matrix.js +0 -2
- package/src/phaser/geom/point.js +9 -11
- package/src/phaser/geom/polygon.js +9 -5
- package/src/phaser/geom/rectangle.js +44 -10
- package/src/phaser/geom/rounded_rectangle.js +0 -2
- package/src/phaser/geom/util/circle.js +3 -3
- package/src/phaser/geom/util/ellipse.js +3 -3
- package/src/phaser/geom/util/line.js +16 -13
- package/src/phaser/geom/util/point.js +1 -1
- package/src/phaser/geom/util/rectangle.js +17 -7
- package/src/phaser/util/math.js +37 -23
- package/tsconfig.json +110 -0
- package/types/index.d.ts +22 -0
- package/types/index.d.ts.map +1 -0
- package/types/phaser/core/animation.d.ts +55 -0
- package/types/phaser/core/animation.d.ts.map +1 -0
- package/types/phaser/core/animation_manager.d.ts +35 -0
- package/types/phaser/core/animation_manager.d.ts.map +1 -0
- package/types/phaser/core/animation_parser.d.ts +20 -0
- package/types/phaser/core/animation_parser.d.ts.map +1 -0
- package/types/phaser/core/array_set.d.ts +23 -0
- package/types/phaser/core/array_set.d.ts.map +1 -0
- package/types/phaser/core/cache.d.ts +106 -0
- package/types/phaser/core/cache.d.ts.map +1 -0
- package/types/phaser/core/const.d.ts +81 -0
- package/types/phaser/core/const.d.ts.map +1 -0
- package/types/phaser/core/device.d.ts +36 -0
- package/types/phaser/core/device.d.ts.map +1 -0
- package/types/phaser/core/device_util.d.ts +48 -0
- package/types/phaser/core/device_util.d.ts.map +1 -0
- package/types/phaser/core/dom.d.ts +63 -0
- package/types/phaser/core/dom.d.ts.map +1 -0
- package/types/phaser/core/event_manager.d.ts +53 -0
- package/types/phaser/core/event_manager.d.ts.map +1 -0
- package/types/phaser/core/factory.d.ts +12 -0
- package/types/phaser/core/factory.d.ts.map +1 -0
- package/types/phaser/core/frame.d.ts +30 -0
- package/types/phaser/core/frame.d.ts.map +1 -0
- package/types/phaser/core/frame_data.d.ts +14 -0
- package/types/phaser/core/frame_data.d.ts.map +1 -0
- package/types/phaser/core/frame_util.d.ts +15 -0
- package/types/phaser/core/frame_util.d.ts.map +1 -0
- package/types/phaser/core/game.d.ts +57 -0
- package/types/phaser/core/game.d.ts.map +1 -0
- package/types/phaser/core/input.d.ts +92 -0
- package/types/phaser/core/input.d.ts.map +1 -0
- package/types/phaser/core/input_handler.d.ts +111 -0
- package/types/phaser/core/input_handler.d.ts.map +1 -0
- package/types/phaser/core/input_mouse.d.ts +39 -0
- package/types/phaser/core/input_mouse.d.ts.map +1 -0
- package/types/phaser/core/input_mspointer.d.ts +34 -0
- package/types/phaser/core/input_mspointer.d.ts.map +1 -0
- package/types/phaser/core/input_pointer.d.ts +68 -0
- package/types/phaser/core/input_pointer.d.ts.map +1 -0
- package/types/phaser/core/input_touch.d.ts +37 -0
- package/types/phaser/core/input_touch.d.ts.map +1 -0
- package/types/phaser/core/loader.d.ts +94 -0
- package/types/phaser/core/loader.d.ts.map +1 -0
- package/types/phaser/core/loader_parser.d.ts +35 -0
- package/types/phaser/core/loader_parser.d.ts.map +1 -0
- package/types/phaser/core/raf.d.ts +15 -0
- package/types/phaser/core/raf.d.ts.map +1 -0
- package/types/phaser/core/scale_manager.d.ts +137 -0
- package/types/phaser/core/scale_manager.d.ts.map +1 -0
- package/types/phaser/core/scene.d.ts +17 -0
- package/types/phaser/core/scene.d.ts.map +1 -0
- package/types/phaser/core/scene_manager.d.ts +39 -0
- package/types/phaser/core/scene_manager.d.ts.map +1 -0
- package/types/phaser/core/signal.d.ts +25 -0
- package/types/phaser/core/signal.d.ts.map +1 -0
- package/types/phaser/core/signal_binding.d.ts +26 -0
- package/types/phaser/core/signal_binding.d.ts.map +1 -0
- package/types/phaser/core/sound.d.ts +72 -0
- package/types/phaser/core/sound.d.ts.map +1 -0
- package/types/phaser/core/sound_manager.d.ts +50 -0
- package/types/phaser/core/sound_manager.d.ts.map +1 -0
- package/types/phaser/core/sound_sprite.d.ts +18 -0
- package/types/phaser/core/sound_sprite.d.ts.map +1 -0
- package/types/phaser/core/stage.d.ts +23 -0
- package/types/phaser/core/stage.d.ts.map +1 -0
- package/types/phaser/core/time.d.ts +49 -0
- package/types/phaser/core/time.d.ts.map +1 -0
- package/types/phaser/core/timer.d.ts +49 -0
- package/types/phaser/core/timer.d.ts.map +1 -0
- package/types/phaser/core/timer_event.d.ts +18 -0
- package/types/phaser/core/timer_event.d.ts.map +1 -0
- package/types/phaser/core/tween.d.ts +52 -0
- package/types/phaser/core/tween.d.ts.map +1 -0
- package/types/phaser/core/tween_data.d.ts +37 -0
- package/types/phaser/core/tween_data.d.ts.map +1 -0
- package/types/phaser/core/tween_easing.d.ts +192 -0
- package/types/phaser/core/tween_easing.d.ts.map +1 -0
- package/types/phaser/core/tween_manager.d.ts +94 -0
- package/types/phaser/core/tween_manager.d.ts.map +1 -0
- package/types/phaser/core/world.d.ts +6 -0
- package/types/phaser/core/world.d.ts.map +1 -0
- package/types/phaser/display/bitmap_text.d.ts +48 -0
- package/types/phaser/display/bitmap_text.d.ts.map +1 -0
- package/types/phaser/display/button.d.ts +33 -0
- package/types/phaser/display/button.d.ts.map +1 -0
- package/types/phaser/display/canvas/buffer.d.ts +11 -0
- package/types/phaser/display/canvas/buffer.d.ts.map +1 -0
- package/types/phaser/display/canvas/graphics.d.ts +18 -0
- package/types/phaser/display/canvas/graphics.d.ts.map +1 -0
- package/types/phaser/display/canvas/masker.d.ts +12 -0
- package/types/phaser/display/canvas/masker.d.ts.map +1 -0
- package/types/phaser/display/canvas/pool.d.ts +45 -0
- package/types/phaser/display/canvas/pool.d.ts.map +1 -0
- package/types/phaser/display/canvas/renderer.d.ts +28 -0
- package/types/phaser/display/canvas/renderer.d.ts.map +1 -0
- package/types/phaser/display/canvas/tinter.d.ts +36 -0
- package/types/phaser/display/canvas/tinter.d.ts.map +1 -0
- package/types/phaser/display/canvas/util.d.ts +70 -0
- package/types/phaser/display/canvas/util.d.ts.map +1 -0
- package/types/phaser/display/display_object.d.ts +83 -0
- package/types/phaser/display/display_object.d.ts.map +1 -0
- package/types/phaser/display/graphics.d.ts +53 -0
- package/types/phaser/display/graphics.d.ts.map +1 -0
- package/types/phaser/display/graphics_data.d.ts +15 -0
- package/types/phaser/display/graphics_data.d.ts.map +1 -0
- package/types/phaser/display/graphics_data_util.d.ts +7 -0
- package/types/phaser/display/graphics_data_util.d.ts.map +1 -0
- package/types/phaser/display/group.d.ts +41 -0
- package/types/phaser/display/group.d.ts.map +1 -0
- package/types/phaser/display/image.d.ts +43 -0
- package/types/phaser/display/image.d.ts.map +1 -0
- package/types/phaser/display/sprite_batch.d.ts +6 -0
- package/types/phaser/display/sprite_batch.d.ts.map +1 -0
- package/types/phaser/display/sprite_util.d.ts +35 -0
- package/types/phaser/display/sprite_util.d.ts.map +1 -0
- package/types/phaser/display/text.d.ts +116 -0
- package/types/phaser/display/text.d.ts.map +1 -0
- package/types/phaser/display/webgl/abstract_filter.d.ts +17 -0
- package/types/phaser/display/webgl/abstract_filter.d.ts.map +1 -0
- package/types/phaser/display/webgl/base_texture.d.ts +20 -0
- package/types/phaser/display/webgl/base_texture.d.ts.map +1 -0
- package/types/phaser/display/webgl/blend_manager.d.ts +14 -0
- package/types/phaser/display/webgl/blend_manager.d.ts.map +1 -0
- package/types/phaser/display/webgl/earcut.d.ts +215 -0
- package/types/phaser/display/webgl/earcut.d.ts.map +1 -0
- package/types/phaser/display/webgl/earcut_node.d.ts +19 -0
- package/types/phaser/display/webgl/earcut_node.d.ts.map +1 -0
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts +34 -0
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -0
- package/types/phaser/display/webgl/filter_manager.d.ts +21 -0
- package/types/phaser/display/webgl/filter_manager.d.ts.map +1 -0
- package/types/phaser/display/webgl/filter_texture.d.ts +13 -0
- package/types/phaser/display/webgl/filter_texture.d.ts.map +1 -0
- package/types/phaser/display/webgl/graphics.d.ts +80 -0
- package/types/phaser/display/webgl/graphics.d.ts.map +1 -0
- package/types/phaser/display/webgl/graphics_data.d.ts +23 -0
- package/types/phaser/display/webgl/graphics_data.d.ts.map +1 -0
- package/types/phaser/display/webgl/mask_manager.d.ts +13 -0
- package/types/phaser/display/webgl/mask_manager.d.ts.map +1 -0
- package/types/phaser/display/webgl/render_texture.d.ts +25 -0
- package/types/phaser/display/webgl/render_texture.d.ts.map +1 -0
- package/types/phaser/display/webgl/renderer.d.ts +44 -0
- package/types/phaser/display/webgl/renderer.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader/complex.d.ts +22 -0
- package/types/phaser/display/webgl/shader/complex.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader/fast.d.ts +25 -0
- package/types/phaser/display/webgl/shader/fast.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader/normal.d.ts +25 -0
- package/types/phaser/display/webgl/shader/normal.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader/primitive.d.ts +21 -0
- package/types/phaser/display/webgl/shader/primitive.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader/strip.d.ts +22 -0
- package/types/phaser/display/webgl/shader/strip.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader_manager.d.ts +24 -0
- package/types/phaser/display/webgl/shader_manager.d.ts.map +1 -0
- package/types/phaser/display/webgl/sprite_batch.d.ts +36 -0
- package/types/phaser/display/webgl/sprite_batch.d.ts.map +1 -0
- package/types/phaser/display/webgl/stencil_manager.d.ts +12 -0
- package/types/phaser/display/webgl/stencil_manager.d.ts.map +1 -0
- package/types/phaser/display/webgl/texture.d.ts +30 -0
- package/types/phaser/display/webgl/texture.d.ts.map +1 -0
- package/types/phaser/display/webgl/texture_util.d.ts +15 -0
- package/types/phaser/display/webgl/texture_util.d.ts.map +1 -0
- package/types/phaser/display/webgl/util.d.ts +41 -0
- package/types/phaser/display/webgl/util.d.ts.map +1 -0
- package/types/phaser/geom/circle.d.ts +39 -0
- package/types/phaser/geom/circle.d.ts.map +1 -0
- package/types/phaser/geom/ellipse.d.ts +18 -0
- package/types/phaser/geom/ellipse.d.ts.map +1 -0
- package/types/phaser/geom/line.d.ts +37 -0
- package/types/phaser/geom/line.d.ts.map +1 -0
- package/types/phaser/geom/matrix.d.ts +25 -0
- package/types/phaser/geom/matrix.d.ts.map +1 -0
- package/types/phaser/geom/point.d.ts +37 -0
- package/types/phaser/geom/point.d.ts.map +1 -0
- package/types/phaser/geom/polygon.d.ts +17 -0
- package/types/phaser/geom/polygon.d.ts.map +1 -0
- package/types/phaser/geom/rectangle.d.ts +63 -0
- package/types/phaser/geom/rectangle.d.ts.map +1 -0
- package/types/phaser/geom/rounded_rectangle.d.ts +12 -0
- package/types/phaser/geom/rounded_rectangle.d.ts.map +1 -0
- package/types/phaser/geom/util/circle.d.ts +55 -0
- package/types/phaser/geom/util/circle.d.ts.map +1 -0
- package/types/phaser/geom/util/ellipse.d.ts +21 -0
- package/types/phaser/geom/util/ellipse.d.ts.map +1 -0
- package/types/phaser/geom/util/line.d.ts +42 -0
- package/types/phaser/geom/util/line.d.ts.map +1 -0
- package/types/phaser/geom/util/matrix.d.ts +20 -0
- package/types/phaser/geom/util/matrix.d.ts.map +1 -0
- package/types/phaser/geom/util/point.d.ts +157 -0
- package/types/phaser/geom/util/point.d.ts.map +1 -0
- package/types/phaser/geom/util/polygon.d.ts +15 -0
- package/types/phaser/geom/util/polygon.d.ts.map +1 -0
- package/types/phaser/geom/util/rectangle.d.ts +124 -0
- package/types/phaser/geom/util/rectangle.d.ts.map +1 -0
- package/types/phaser/geom/util/rounded_rectangle.d.ts +15 -0
- package/types/phaser/geom/util/rounded_rectangle.d.ts.map +1 -0
- package/types/phaser/util/math.d.ts +162 -0
- package/types/phaser/util/math.d.ts.map +1 -0
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import SignalBinding from './signal_binding';
|
|
7
7
|
|
|
8
8
|
export default class {
|
|
9
|
-
|
|
10
9
|
constructor() {
|
|
11
10
|
this._bindings = null;
|
|
12
11
|
this._prevParams = null;
|
|
@@ -18,7 +17,12 @@ export default class {
|
|
|
18
17
|
|
|
19
18
|
validateListener(listener, fnName) {
|
|
20
19
|
if (typeof listener !== 'function') {
|
|
21
|
-
throw new Error(
|
|
20
|
+
throw new Error(
|
|
21
|
+
'Signal: listener is a required param of {fn}() and should be a Function.'.replace(
|
|
22
|
+
'{fn}',
|
|
23
|
+
fnName
|
|
24
|
+
)
|
|
25
|
+
);
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -28,7 +32,13 @@ export default class {
|
|
|
28
32
|
if (prevIndex !== -1) {
|
|
29
33
|
binding = this._bindings[prevIndex];
|
|
30
34
|
if (binding.isOnce() !== isOnce) {
|
|
31
|
-
throw new Error(
|
|
35
|
+
throw new Error(
|
|
36
|
+
'You cannot add' +
|
|
37
|
+
(isOnce ? '' : 'Once') +
|
|
38
|
+
'() then add' +
|
|
39
|
+
(!isOnce ? '' : 'Once') +
|
|
40
|
+
'() the same listener without removing the relationship first.'
|
|
41
|
+
);
|
|
32
42
|
}
|
|
33
43
|
} else {
|
|
34
44
|
binding = new SignalBinding(this, listener, isOnce, listenerContext, priority, args);
|
|
@@ -48,8 +58,7 @@ export default class {
|
|
|
48
58
|
let n = this._bindings.length;
|
|
49
59
|
do {
|
|
50
60
|
n -= 1;
|
|
51
|
-
}
|
|
52
|
-
while (this._bindings[n] && binding._priority <= this._bindings[n]._priority);
|
|
61
|
+
} while (this._bindings[n] && binding._priority <= this._bindings[n]._priority);
|
|
53
62
|
this._bindings.splice(n + 1, 0, binding);
|
|
54
63
|
}
|
|
55
64
|
|
|
@@ -144,8 +153,7 @@ export default class {
|
|
|
144
153
|
// reverse loop since listeners with higher priority will be added at the end of the list
|
|
145
154
|
do {
|
|
146
155
|
n -= 1;
|
|
147
|
-
}
|
|
148
|
-
while (bindings[n] && this._shouldPropagate && bindings[n].execute(paramsArr) !== false);
|
|
156
|
+
} while (bindings[n] && this._shouldPropagate && bindings[n].execute(paramsArr) !== false);
|
|
149
157
|
}
|
|
150
158
|
|
|
151
159
|
forget() {
|
|
@@ -171,5 +179,4 @@ export default class {
|
|
|
171
179
|
}
|
|
172
180
|
return this._boundDispatch;
|
|
173
181
|
}
|
|
174
|
-
|
|
175
182
|
}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export default class {
|
|
8
|
-
|
|
9
8
|
constructor(signal, listener, isOnce = false, listenerContext = null, priority = 0, args = null) {
|
|
10
9
|
this._signal = signal;
|
|
11
10
|
this._listener = listener;
|
|
@@ -33,7 +32,6 @@ export default class {
|
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
return handlerReturn;
|
|
36
|
-
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
detach() {
|
|
@@ -41,7 +39,7 @@ export default class {
|
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
isBound() {
|
|
44
|
-
return
|
|
42
|
+
return !!this._signal && !!this._listener;
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
isOnce() {
|
|
@@ -63,7 +61,14 @@ export default class {
|
|
|
63
61
|
}
|
|
64
62
|
|
|
65
63
|
toString() {
|
|
66
|
-
return
|
|
64
|
+
return (
|
|
65
|
+
'[SignalBinding isOnce:' +
|
|
66
|
+
this._isOnce +
|
|
67
|
+
', isBound:' +
|
|
68
|
+
this.isBound() +
|
|
69
|
+
', active:' +
|
|
70
|
+
this.active +
|
|
71
|
+
']'
|
|
72
|
+
);
|
|
67
73
|
}
|
|
68
|
-
|
|
69
74
|
}
|
package/src/phaser/core/sound.js
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import Signal from './signal';
|
|
7
7
|
|
|
8
8
|
export default class {
|
|
9
|
-
|
|
10
9
|
constructor(game, key, volume = 1, loop = false, connect = null) {
|
|
11
10
|
// TODO
|
|
12
11
|
// https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Migrating_from_webkitAudioContext
|
|
@@ -179,8 +178,12 @@ export default class {
|
|
|
179
178
|
}
|
|
180
179
|
|
|
181
180
|
play(marker, position, volume, loop, forceRestart) {
|
|
182
|
-
if (marker === undefined || marker === false || marker === null) {
|
|
183
|
-
|
|
181
|
+
if (marker === undefined || marker === false || marker === null) {
|
|
182
|
+
marker = '';
|
|
183
|
+
}
|
|
184
|
+
if (forceRestart === undefined) {
|
|
185
|
+
forceRestart = true;
|
|
186
|
+
}
|
|
184
187
|
|
|
185
188
|
if (this.isPlaying && !this.allowMultiple && !forceRestart && !this.override) {
|
|
186
189
|
// Use Restart instead
|
|
@@ -231,8 +234,12 @@ export default class {
|
|
|
231
234
|
}
|
|
232
235
|
} else {
|
|
233
236
|
position = position || 0;
|
|
234
|
-
if (volume === undefined) {
|
|
235
|
-
|
|
237
|
+
if (volume === undefined) {
|
|
238
|
+
volume = this._volume;
|
|
239
|
+
}
|
|
240
|
+
if (loop === undefined) {
|
|
241
|
+
loop = this.loop;
|
|
242
|
+
}
|
|
236
243
|
this.position = Math.max(0, position);
|
|
237
244
|
this.volume = volume;
|
|
238
245
|
this.loop = loop;
|
|
@@ -280,7 +287,10 @@ export default class {
|
|
|
280
287
|
this.onPlay.dispatch(this);
|
|
281
288
|
} else {
|
|
282
289
|
this.pendingPlayback = true;
|
|
283
|
-
if (
|
|
290
|
+
if (
|
|
291
|
+
this.game.cache.getSound(this.key) &&
|
|
292
|
+
this.game.cache.getSound(this.key).isDecoding === false
|
|
293
|
+
) {
|
|
284
294
|
this.game.sound.decode(this.key, this);
|
|
285
295
|
}
|
|
286
296
|
}
|
|
@@ -331,7 +341,7 @@ export default class {
|
|
|
331
341
|
resume() {
|
|
332
342
|
if (this.paused && this._sound) {
|
|
333
343
|
if (!this.game.sound.noAudio) {
|
|
334
|
-
const p = Math.max(0, this.position +
|
|
344
|
+
const p = Math.max(0, this.position + this.pausedPosition / 1000);
|
|
335
345
|
this._sound = this.context.createBufferSource();
|
|
336
346
|
this._sound.buffer = this._buffer;
|
|
337
347
|
if (this.externalNode) {
|
|
@@ -345,7 +355,7 @@ export default class {
|
|
|
345
355
|
if (!this.loop && this.currentMarker === '') {
|
|
346
356
|
this._sound.onended = this.onEndedHandler.bind(this);
|
|
347
357
|
}
|
|
348
|
-
const duration = this.duration -
|
|
358
|
+
const duration = this.duration - this.pausedPosition / 1000;
|
|
349
359
|
if (this._sound.start === undefined) {
|
|
350
360
|
this._sound.noteGrainOn(0, p, duration);
|
|
351
361
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=457099
|
|
@@ -357,7 +367,7 @@ export default class {
|
|
|
357
367
|
}
|
|
358
368
|
this.isPlaying = true;
|
|
359
369
|
this.paused = false;
|
|
360
|
-
this.startTime +=
|
|
370
|
+
this.startTime += this.game.time.time - this.pausedTime;
|
|
361
371
|
this.onResume.dispatch(this);
|
|
362
372
|
}
|
|
363
373
|
}
|
|
@@ -441,7 +451,7 @@ export default class {
|
|
|
441
451
|
}
|
|
442
452
|
|
|
443
453
|
get mute() {
|
|
444
|
-
return
|
|
454
|
+
return this._muted || this.game.sound.mute;
|
|
445
455
|
}
|
|
446
456
|
|
|
447
457
|
set mute(value) {
|
|
@@ -479,5 +489,4 @@ export default class {
|
|
|
479
489
|
this.gainNode.gain.value = value;
|
|
480
490
|
}
|
|
481
491
|
}
|
|
482
|
-
|
|
483
492
|
}
|
|
@@ -9,7 +9,6 @@ import Sound from './sound';
|
|
|
9
9
|
import SoundSprite from './sound_sprite';
|
|
10
10
|
|
|
11
11
|
export default class {
|
|
12
|
-
|
|
13
12
|
constructor(game) {
|
|
14
13
|
this.game = game;
|
|
15
14
|
this.onChange = new Signal();
|
|
@@ -56,11 +55,16 @@ export default class {
|
|
|
56
55
|
this.game.exceptionHandler(e);
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
|
-
if (
|
|
58
|
+
if (
|
|
59
|
+
this.context === null ||
|
|
60
|
+
(this.context &&
|
|
61
|
+
this.context.createGain === undefined &&
|
|
62
|
+
this.context.createGainNode === undefined)
|
|
63
|
+
) {
|
|
60
64
|
this.noAudio = true;
|
|
61
65
|
return;
|
|
62
|
-
}
|
|
63
|
-
this.baseLatency = this.context.baseLatency ||
|
|
66
|
+
}
|
|
67
|
+
this.baseLatency = this.context.baseLatency || 256 / (this.context.sampleRate || 44100);
|
|
64
68
|
if (this.context.createGain === undefined) {
|
|
65
69
|
this.masterGain = this.context.createGainNode();
|
|
66
70
|
} else {
|
|
@@ -75,18 +79,27 @@ export default class {
|
|
|
75
79
|
this.addUnlockHandlers();
|
|
76
80
|
}
|
|
77
81
|
this.context.addEventListener('statechange', () => {
|
|
78
|
-
this.onChange.dispatch('onContextStateChange', {
|
|
79
|
-
|
|
82
|
+
this.onChange.dispatch('onContextStateChange', {
|
|
83
|
+
state: this.context.state,
|
|
84
|
+
isLocked: this.isLocked,
|
|
85
|
+
});
|
|
86
|
+
if (
|
|
87
|
+
!this.isLocked &&
|
|
88
|
+
(this.context.state === 'suspended' || this.context.state === 'interrupted')
|
|
89
|
+
) {
|
|
80
90
|
this.addUnlockHandlers();
|
|
81
91
|
} else if (this.isLocked && this.context.state === 'running') {
|
|
82
92
|
this.removeUnlockHandlers();
|
|
83
|
-
}
|
|
93
|
+
}
|
|
84
94
|
});
|
|
85
95
|
}
|
|
86
96
|
|
|
87
97
|
addUnlockHandlers() {
|
|
88
98
|
this.isLocked = true;
|
|
89
|
-
this.onChange.dispatch('addUnlockHandlers', {
|
|
99
|
+
this.onChange.dispatch('addUnlockHandlers', {
|
|
100
|
+
state: this.context.state,
|
|
101
|
+
isLocked: this.isLocked,
|
|
102
|
+
});
|
|
90
103
|
document.body.addEventListener('touchstart', this.onUnlockEventBinded, false);
|
|
91
104
|
document.body.addEventListener('touchend', this.onUnlockEventBinded, false);
|
|
92
105
|
document.body.addEventListener('click', this.onUnlockEventBinded, false);
|
|
@@ -95,7 +108,10 @@ export default class {
|
|
|
95
108
|
|
|
96
109
|
removeUnlockHandlers() {
|
|
97
110
|
this.isLocked = false;
|
|
98
|
-
this.onChange.dispatch('removeUnlockHandlers', {
|
|
111
|
+
this.onChange.dispatch('removeUnlockHandlers', {
|
|
112
|
+
state: this.context.state,
|
|
113
|
+
isLocked: this.isLocked,
|
|
114
|
+
});
|
|
99
115
|
document.body.removeEventListener('touchstart', this.onUnlockEventBinded);
|
|
100
116
|
document.body.removeEventListener('touchend', this.onUnlockEventBinded);
|
|
101
117
|
document.body.removeEventListener('click', this.onUnlockEventBinded);
|
|
@@ -105,19 +121,39 @@ export default class {
|
|
|
105
121
|
onUnlockEvent(event) {
|
|
106
122
|
const initialState = this.context.state;
|
|
107
123
|
if (initialState !== 'suspended' && initialState !== 'interrupted') {
|
|
108
|
-
this.onChange.dispatch('onUnlockResumeDenied', {
|
|
124
|
+
this.onChange.dispatch('onUnlockResumeDenied', {
|
|
125
|
+
state: initialState,
|
|
126
|
+
isLocked: this.isLocked,
|
|
127
|
+
event,
|
|
128
|
+
});
|
|
109
129
|
this.removeUnlockHandlers();
|
|
110
130
|
return;
|
|
111
131
|
}
|
|
112
|
-
this.onChange.dispatch('onContextResumeStart', {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}).catch((e) => {
|
|
117
|
-
this.onChange.dispatch('onContextResumeReject', { initialState, state: this.context.state, isLocked: this.isLocked, error: e });
|
|
118
|
-
this.removeUnlockHandlers();
|
|
119
|
-
this.game.exceptionHandler(e, { initialState, state: this.context.state });
|
|
132
|
+
this.onChange.dispatch('onContextResumeStart', {
|
|
133
|
+
state: initialState,
|
|
134
|
+
isLocked: this.isLocked,
|
|
135
|
+
event,
|
|
120
136
|
});
|
|
137
|
+
this.context
|
|
138
|
+
.resume()
|
|
139
|
+
.then(() => {
|
|
140
|
+
this.onChange.dispatch('onContextResumeResult', {
|
|
141
|
+
initialState,
|
|
142
|
+
state: this.context.state,
|
|
143
|
+
isLocked: this.isLocked,
|
|
144
|
+
});
|
|
145
|
+
this.removeUnlockHandlers();
|
|
146
|
+
})
|
|
147
|
+
.catch((e) => {
|
|
148
|
+
this.onChange.dispatch('onContextResumeReject', {
|
|
149
|
+
initialState,
|
|
150
|
+
state: this.context.state,
|
|
151
|
+
isLocked: this.isLocked,
|
|
152
|
+
error: e,
|
|
153
|
+
});
|
|
154
|
+
this.removeUnlockHandlers();
|
|
155
|
+
this.game.exceptionHandler(e, { initialState, state: this.context.state });
|
|
156
|
+
});
|
|
121
157
|
}
|
|
122
158
|
|
|
123
159
|
stopAll() {
|
|
@@ -158,7 +194,8 @@ export default class {
|
|
|
158
194
|
if (soundData) {
|
|
159
195
|
if (this.game.cache.isSoundDecoded(key) === false) {
|
|
160
196
|
this.game.cache.updateSound(key, 'isDecoding', true);
|
|
161
|
-
this.context
|
|
197
|
+
this.context
|
|
198
|
+
.decodeAudioData(soundData)
|
|
162
199
|
.then((buffer) => {
|
|
163
200
|
this.game.cache.decodedSound(key, buffer);
|
|
164
201
|
})
|
|
@@ -340,5 +377,4 @@ export default class {
|
|
|
340
377
|
}
|
|
341
378
|
}
|
|
342
379
|
}
|
|
343
|
-
|
|
344
380
|
}
|
|
@@ -4,41 +4,41 @@
|
|
|
4
4
|
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
5
5
|
*/
|
|
6
6
|
export default class {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
if (this.config.autoplay) {
|
|
21
|
-
this.autoplayKey = this.config.autoplay;
|
|
22
|
-
this.play(this.autoplayKey);
|
|
23
|
-
this.autoplay = this.sounds[this.autoplayKey];
|
|
24
|
-
}
|
|
7
|
+
constructor(game, key) {
|
|
8
|
+
this.game = game;
|
|
9
|
+
this.key = key;
|
|
10
|
+
this.config = this.game.cache.getJSON(key + '-audioatlas');
|
|
11
|
+
this.autoplayKey = null;
|
|
12
|
+
this.autoplay = false;
|
|
13
|
+
this.sounds = {};
|
|
14
|
+
for (let k in this.config.spritemap) {
|
|
15
|
+
const marker = this.config.spritemap[k];
|
|
16
|
+
const sound = this.game.sound.add(this.key);
|
|
17
|
+
sound.addMarker(k, marker.start, marker.end - marker.start, null, marker.loop);
|
|
18
|
+
this.sounds[k] = sound;
|
|
25
19
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
if (this.config.autoplay) {
|
|
21
|
+
this.autoplayKey = this.config.autoplay;
|
|
22
|
+
this.play(this.autoplayKey);
|
|
23
|
+
this.autoplay = this.sounds[this.autoplayKey];
|
|
29
24
|
}
|
|
25
|
+
}
|
|
30
26
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this.sounds[key].stop();
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
this.sounds[marker].stop();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
27
|
+
play(marker, volume = 1) {
|
|
28
|
+
return this.sounds[marker].play(marker, null, volume);
|
|
29
|
+
}
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
stop(marker) {
|
|
32
|
+
if (!marker) {
|
|
33
|
+
for (let key in this.sounds) {
|
|
34
|
+
this.sounds[key].stop();
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
this.sounds[marker].stop();
|
|
43
38
|
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get(marker) {
|
|
42
|
+
return this.sounds[marker];
|
|
43
|
+
}
|
|
44
44
|
}
|
package/src/phaser/core/stage.js
CHANGED
|
@@ -10,7 +10,6 @@ import { valueToColor } from '../util/math';
|
|
|
10
10
|
import { SCALE_LINEAR, SCALE_NEAREST } from './const';
|
|
11
11
|
|
|
12
12
|
export default class extends DisplayObject {
|
|
13
|
-
|
|
14
13
|
constructor(game) {
|
|
15
14
|
super();
|
|
16
15
|
this.game = game;
|
|
@@ -103,6 +102,4 @@ export default class extends DisplayObject {
|
|
|
103
102
|
set smoothed(value) {
|
|
104
103
|
window.PhaserRegistry.TEXTURE_SCALE_MODE = value ? SCALE_LINEAR : SCALE_NEAREST;
|
|
105
104
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
105
|
}
|
package/src/phaser/core/time.js
CHANGED
package/src/phaser/core/timer.js
CHANGED
|
@@ -7,7 +7,6 @@ import Signal from './signal';
|
|
|
7
7
|
import TimerEvent from './timer_event';
|
|
8
8
|
|
|
9
9
|
export default class {
|
|
10
|
-
|
|
11
10
|
constructor(game, autoDestroy = false) {
|
|
12
11
|
this.game = game;
|
|
13
12
|
this.running = false;
|
|
@@ -39,7 +38,16 @@ export default class {
|
|
|
39
38
|
} else {
|
|
40
39
|
tick += this._now;
|
|
41
40
|
}
|
|
42
|
-
const event = new TimerEvent(
|
|
41
|
+
const event = new TimerEvent(
|
|
42
|
+
this,
|
|
43
|
+
roundedDelay,
|
|
44
|
+
tick,
|
|
45
|
+
repeatCount,
|
|
46
|
+
loop,
|
|
47
|
+
callback,
|
|
48
|
+
callbackContext,
|
|
49
|
+
args
|
|
50
|
+
);
|
|
43
51
|
this.events.push(event);
|
|
44
52
|
this.order();
|
|
45
53
|
this.expired = false;
|
|
@@ -135,21 +143,31 @@ export default class {
|
|
|
135
143
|
while (this._i < this._len && this.running) {
|
|
136
144
|
if (this._now >= this.events[this._i].tick && !this.events[this._i].pendingDelete) {
|
|
137
145
|
// (now + delay) - (time difference from last tick to now)
|
|
138
|
-
this._newTick =
|
|
146
|
+
this._newTick =
|
|
147
|
+
this._now + this.events[this._i].delay - (this._now - this.events[this._i].tick);
|
|
139
148
|
if (this._newTick < 0) {
|
|
140
149
|
this._newTick = this._now + this.events[this._i].delay;
|
|
141
150
|
}
|
|
142
151
|
if (this.events[this._i].loop === true) {
|
|
143
152
|
this.events[this._i].tick = this._newTick;
|
|
144
|
-
this.events[this._i].callback.apply(
|
|
153
|
+
this.events[this._i].callback.apply(
|
|
154
|
+
this.events[this._i].callbackContext,
|
|
155
|
+
this.events[this._i].args
|
|
156
|
+
);
|
|
145
157
|
} else if (this.events[this._i].repeatCount > 0) {
|
|
146
158
|
this.events[this._i].repeatCount -= 1;
|
|
147
159
|
this.events[this._i].tick = this._newTick;
|
|
148
|
-
this.events[this._i].callback.apply(
|
|
160
|
+
this.events[this._i].callback.apply(
|
|
161
|
+
this.events[this._i].callbackContext,
|
|
162
|
+
this.events[this._i].args
|
|
163
|
+
);
|
|
149
164
|
} else {
|
|
150
165
|
this._marked += 1;
|
|
151
166
|
this.events[this._i].pendingDelete = true;
|
|
152
|
-
this.events[this._i].callback.apply(
|
|
167
|
+
this.events[this._i].callback.apply(
|
|
168
|
+
this.events[this._i].callbackContext,
|
|
169
|
+
this.events[this._i].args
|
|
170
|
+
);
|
|
153
171
|
}
|
|
154
172
|
this._i += 1;
|
|
155
173
|
} else {
|
|
@@ -272,5 +290,4 @@ export default class {
|
|
|
272
290
|
}
|
|
273
291
|
return 0;
|
|
274
292
|
}
|
|
275
|
-
|
|
276
293
|
}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
export default class {
|
|
8
|
-
|
|
9
8
|
constructor(timer, delay, tick, repeatCount, loop, callback, callbackContext, args) {
|
|
10
9
|
this.timer = timer;
|
|
11
10
|
this.delay = delay;
|
|
@@ -17,5 +16,4 @@ export default class {
|
|
|
17
16
|
this.args = args;
|
|
18
17
|
this.pendingDelete = false;
|
|
19
18
|
}
|
|
20
|
-
|
|
21
19
|
}
|
package/src/phaser/core/tween.js
CHANGED
|
@@ -9,7 +9,6 @@ import * as MathUtils from '../util/math';
|
|
|
9
9
|
import { TWEEN_PENDING, TWEEN_RUNNING, TWEEN_COMPLETE, TWEEN_LOOPED } from './const';
|
|
10
10
|
|
|
11
11
|
export default class {
|
|
12
|
-
|
|
13
12
|
constructor(target, game, manager) {
|
|
14
13
|
this.game = game;
|
|
15
14
|
this.target = target;
|
|
@@ -36,7 +35,15 @@ export default class {
|
|
|
36
35
|
this._hasStarted = false;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
to(
|
|
38
|
+
to(
|
|
39
|
+
properties,
|
|
40
|
+
duration = 1000,
|
|
41
|
+
ease = 'Linear',
|
|
42
|
+
autoStart = false,
|
|
43
|
+
delay = 0,
|
|
44
|
+
repeat = 0,
|
|
45
|
+
yoyo = false
|
|
46
|
+
) {
|
|
40
47
|
if (typeof ease === 'string' && this.manager.easeMap[ease]) {
|
|
41
48
|
ease = this.manager.easeMap[ease];
|
|
42
49
|
}
|
|
@@ -50,7 +57,15 @@ export default class {
|
|
|
50
57
|
return this;
|
|
51
58
|
}
|
|
52
59
|
|
|
53
|
-
from(
|
|
60
|
+
from(
|
|
61
|
+
properties,
|
|
62
|
+
duration = 1000,
|
|
63
|
+
ease = 'Linear',
|
|
64
|
+
autoStart = false,
|
|
65
|
+
delay = 0,
|
|
66
|
+
repeat = 0,
|
|
67
|
+
yoyo = false
|
|
68
|
+
) {
|
|
54
69
|
if (typeof ease === 'string' && this.manager.easeMap[ease]) {
|
|
55
70
|
ease = this.manager.easeMap[ease];
|
|
56
71
|
}
|
|
@@ -66,7 +81,12 @@ export default class {
|
|
|
66
81
|
}
|
|
67
82
|
|
|
68
83
|
start(index = 0) {
|
|
69
|
-
if (
|
|
84
|
+
if (
|
|
85
|
+
this.game === null ||
|
|
86
|
+
this.target === null ||
|
|
87
|
+
this.timeline.length === 0 ||
|
|
88
|
+
this.isRunning
|
|
89
|
+
) {
|
|
70
90
|
return this;
|
|
71
91
|
}
|
|
72
92
|
// Populate the tween data
|
|
@@ -177,7 +197,7 @@ export default class {
|
|
|
177
197
|
}
|
|
178
198
|
|
|
179
199
|
loop(value = true) {
|
|
180
|
-
this.repeatCounter =
|
|
200
|
+
this.repeatCounter = value ? -1 : 0;
|
|
181
201
|
return this;
|
|
182
202
|
}
|
|
183
203
|
|
|
@@ -206,7 +226,7 @@ export default class {
|
|
|
206
226
|
this._codePaused = false;
|
|
207
227
|
for (let i = 0; i < this.timeline.length; i += 1) {
|
|
208
228
|
if (!this.timeline[i].isRunning) {
|
|
209
|
-
this.timeline[i].startTime +=
|
|
229
|
+
this.timeline[i].startTime += this.game.time.time - this._pausedTime;
|
|
210
230
|
}
|
|
211
231
|
}
|
|
212
232
|
}
|
|
@@ -234,7 +254,12 @@ export default class {
|
|
|
234
254
|
this._hasStarted = true;
|
|
235
255
|
}
|
|
236
256
|
if (this._onUpdateCallback !== null) {
|
|
237
|
-
this._onUpdateCallback.call(
|
|
257
|
+
this._onUpdateCallback.call(
|
|
258
|
+
this._onUpdateCallbackContext,
|
|
259
|
+
this,
|
|
260
|
+
this.timeline[this.current].value,
|
|
261
|
+
this.timeline[this.current]
|
|
262
|
+
);
|
|
238
263
|
}
|
|
239
264
|
// In case the update callback modifies this tween
|
|
240
265
|
return this.isRunning;
|
|
@@ -324,5 +349,4 @@ export default class {
|
|
|
324
349
|
}
|
|
325
350
|
return total;
|
|
326
351
|
}
|
|
327
|
-
|
|
328
352
|
}
|
|
@@ -7,7 +7,6 @@ import * as MathUtils from '../util/math';
|
|
|
7
7
|
import { TWEEN_PENDING, TWEEN_RUNNING, TWEEN_COMPLETE, TWEEN_LOOPED } from './const';
|
|
8
8
|
|
|
9
9
|
export default class {
|
|
10
|
-
|
|
11
10
|
constructor(parent) {
|
|
12
11
|
this.parent = parent;
|
|
13
12
|
this.game = parent.game;
|
|
@@ -145,12 +144,19 @@ export default class {
|
|
|
145
144
|
const start = this.vStart[property];
|
|
146
145
|
const end = this.vEnd[property];
|
|
147
146
|
if (Array.isArray(end)) {
|
|
148
|
-
this.parent.target[property] = this.interpolationFunction.call(
|
|
147
|
+
this.parent.target[property] = this.interpolationFunction.call(
|
|
148
|
+
this.interpolationContext,
|
|
149
|
+
end,
|
|
150
|
+
this.value
|
|
151
|
+
);
|
|
149
152
|
} else {
|
|
150
|
-
this.parent.target[property] = start + (
|
|
153
|
+
this.parent.target[property] = start + (end - start) * this.value;
|
|
151
154
|
}
|
|
152
155
|
}
|
|
153
|
-
if (
|
|
156
|
+
if (
|
|
157
|
+
(!this.parent.reverse && this.percent === 1) ||
|
|
158
|
+
(this.parent.reverse && this.percent === 0)
|
|
159
|
+
) {
|
|
154
160
|
return this.repeat();
|
|
155
161
|
}
|
|
156
162
|
return TWEEN_RUNNING;
|
|
@@ -184,11 +190,14 @@ export default class {
|
|
|
184
190
|
if (Array.isArray(end)) {
|
|
185
191
|
blob[property] = this.interpolationFunction(end, this.value);
|
|
186
192
|
} else {
|
|
187
|
-
blob[property] = start + (
|
|
193
|
+
blob[property] = start + (end - start) * this.value;
|
|
188
194
|
}
|
|
189
195
|
}
|
|
190
196
|
data.push(blob);
|
|
191
|
-
if (
|
|
197
|
+
if (
|
|
198
|
+
(!this.parent.reverse && this.percent === 1) ||
|
|
199
|
+
(this.parent.reverse && this.percent === 0)
|
|
200
|
+
) {
|
|
192
201
|
complete = true;
|
|
193
202
|
}
|
|
194
203
|
} while (!complete);
|
|
@@ -254,5 +263,4 @@ export default class {
|
|
|
254
263
|
}
|
|
255
264
|
return TWEEN_LOOPED;
|
|
256
265
|
}
|
|
257
|
-
|
|
258
266
|
}
|