@vpmedia/phaser 1.14.0 → 1.16.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 +3 -3
- package/package.json +6 -5
- package/src/index.js +15 -18
- package/src/phaser/core/animation.js +102 -6
- package/src/phaser/core/animation_manager.js +88 -10
- package/src/phaser/core/animation_parser.js +5 -20
- package/src/phaser/core/array_set.js +51 -5
- package/src/phaser/core/cache.js +291 -6
- package/src/phaser/core/const.js +107 -4
- package/src/phaser/core/device.js +5 -6
- package/src/phaser/core/device_util.js +3 -25
- package/src/phaser/core/dom.js +127 -29
- package/src/phaser/core/event_manager.js +128 -6
- package/src/phaser/core/factory.js +69 -34
- package/src/phaser/core/frame.js +43 -6
- package/src/phaser/core/frame_data.js +55 -5
- package/src/phaser/core/frame_util.js +7 -14
- package/src/phaser/core/game.js +35 -7
- package/src/phaser/core/input.js +116 -17
- package/src/phaser/core/input_handler.js +242 -42
- package/src/phaser/core/input_mouse.js +68 -7
- package/src/phaser/core/input_mspointer.js +40 -9
- package/src/phaser/core/input_pointer.js +79 -17
- package/src/phaser/core/input_touch.js +42 -5
- package/src/phaser/core/loader.js +274 -101
- package/src/phaser/core/loader_parser.js +2 -14
- package/src/phaser/core/raf.js +16 -5
- package/src/phaser/core/scale_manager.js +204 -39
- package/src/phaser/core/scene.js +24 -5
- package/src/phaser/core/scene_manager.js +81 -11
- package/src/phaser/core/signal.js +88 -11
- package/src/phaser/core/signal_binding.js +35 -15
- package/src/phaser/core/sound.js +99 -10
- package/src/phaser/core/sound_manager.js +89 -13
- package/src/phaser/core/sound_sprite.js +20 -5
- package/src/phaser/core/stage.js +43 -7
- package/src/phaser/core/time.js +67 -5
- package/src/phaser/core/timer.js +107 -30
- package/src/phaser/core/timer_event.js +11 -6
- package/src/phaser/core/tween.js +124 -30
- package/src/phaser/core/tween_data.js +42 -18
- package/src/phaser/core/tween_easing.js +1 -39
- package/src/phaser/core/tween_manager.js +47 -5
- package/src/phaser/core/world.js +9 -6
- package/src/phaser/display/bitmap_text.js +92 -11
- package/src/phaser/display/button.js +64 -13
- package/src/phaser/display/canvas/buffer.js +16 -6
- package/src/phaser/display/canvas/graphics.js +1 -16
- package/src/phaser/display/canvas/masker.js +0 -8
- package/src/phaser/display/canvas/pool.js +0 -14
- package/src/phaser/display/canvas/renderer.js +28 -8
- package/src/phaser/display/canvas/tinter.js +4 -48
- package/src/phaser/display/canvas/util.js +0 -15
- package/src/phaser/display/display_object.js +192 -20
- package/src/phaser/display/graphics.js +162 -27
- package/src/phaser/display/graphics_data.js +14 -6
- package/src/phaser/display/graphics_data_util.js +2 -9
- package/src/phaser/display/group.js +75 -10
- package/src/phaser/display/image.js +86 -10
- package/src/phaser/display/sprite_batch.js +3 -9
- package/src/phaser/display/sprite_util.js +3 -28
- package/src/phaser/display/text.js +332 -32
- package/src/phaser/display/webgl/abstract_filter.js +8 -7
- package/src/phaser/display/webgl/base_texture.js +20 -12
- package/src/phaser/display/webgl/blend_manager.js +14 -7
- package/src/phaser/display/webgl/earcut.js +4 -50
- package/src/phaser/display/webgl/earcut_node.js +6 -7
- package/src/phaser/display/webgl/fast_sprite_batch.js +34 -11
- package/src/phaser/display/webgl/filter_manager.js +25 -7
- package/src/phaser/display/webgl/filter_texture.js +21 -22
- package/src/phaser/display/webgl/graphics.js +5 -40
- package/src/phaser/display/webgl/graphics_data.js +10 -7
- package/src/phaser/display/webgl/mask_manager.js +0 -8
- package/src/phaser/display/webgl/render_texture.js +33 -21
- package/src/phaser/display/webgl/renderer.js +38 -11
- package/src/phaser/display/webgl/shader/complex.js +10 -6
- package/src/phaser/display/webgl/shader/fast.js +10 -6
- package/src/phaser/display/webgl/shader/normal.js +23 -32
- package/src/phaser/display/webgl/shader/primitive.js +10 -6
- package/src/phaser/display/webgl/shader/strip.js +10 -6
- package/src/phaser/display/webgl/shader_manager.js +18 -6
- package/src/phaser/display/webgl/sprite_batch.js +41 -8
- package/src/phaser/display/webgl/stencil_manager.js +28 -6
- package/src/phaser/display/webgl/texture.js +28 -15
- package/src/phaser/display/webgl/texture_util.js +0 -8
- package/src/phaser/display/webgl/util.js +0 -11
- package/src/phaser/geom/circle.js +123 -19
- package/src/phaser/geom/ellipse.js +39 -19
- package/src/phaser/geom/line.js +148 -17
- package/src/phaser/geom/matrix.js +73 -7
- package/src/phaser/geom/point.js +152 -7
- package/src/phaser/geom/polygon.js +42 -14
- package/src/phaser/geom/rectangle.js +233 -7
- package/src/phaser/geom/rounded_rectangle.js +10 -7
- package/src/phaser/geom/util/circle.js +3 -16
- package/src/phaser/geom/util/ellipse.js +0 -8
- package/src/phaser/geom/util/line.js +5 -19
- package/src/phaser/geom/util/matrix.js +1 -10
- package/src/phaser/geom/util/point.js +0 -26
- package/src/phaser/geom/util/polygon.js +1 -8
- package/src/phaser/geom/util/rectangle.js +1 -23
- package/src/phaser/geom/util/rounded_rectangle.js +1 -8
- package/src/phaser/util/math.js +3 -43
- package/{types → typedefs}/global.d.ts +1 -1
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/phaser/core/animation.d.ts +106 -5
- package/types/phaser/core/animation.d.ts.map +1 -1
- package/types/phaser/core/animation_manager.d.ts +88 -1
- package/types/phaser/core/animation_manager.d.ts.map +1 -1
- package/types/phaser/core/animation_parser.d.ts +5 -6
- package/types/phaser/core/animation_parser.d.ts.map +1 -1
- package/types/phaser/core/array_set.d.ts +53 -7
- package/types/phaser/core/array_set.d.ts.map +1 -1
- package/types/phaser/core/cache.d.ts +348 -58
- package/types/phaser/core/cache.d.ts.map +1 -1
- package/types/phaser/core/const.d.ts +143 -40
- package/types/phaser/core/const.d.ts.map +1 -1
- package/types/phaser/core/device.d.ts +2 -5
- package/types/phaser/core/device.d.ts.map +1 -1
- package/types/phaser/core/device_util.d.ts +1 -10
- package/types/phaser/core/device_util.d.ts.map +1 -1
- package/types/phaser/core/dom.d.ts +122 -3
- package/types/phaser/core/dom.d.ts.map +1 -1
- package/types/phaser/core/event_manager.d.ts +142 -15
- package/types/phaser/core/event_manager.d.ts.map +1 -1
- package/types/phaser/core/factory.d.ts +74 -7
- package/types/phaser/core/factory.d.ts.map +1 -1
- package/types/phaser/core/frame.d.ts +68 -26
- package/types/phaser/core/frame.d.ts.map +1 -1
- package/types/phaser/core/frame_data.d.ts +61 -9
- package/types/phaser/core/frame_data.d.ts.map +1 -1
- package/types/phaser/core/frame_util.d.ts +10 -10
- package/types/phaser/core/frame_util.d.ts.map +1 -1
- package/types/phaser/core/game.d.ts +54 -20
- package/types/phaser/core/game.d.ts.map +1 -1
- package/types/phaser/core/input.d.ts +132 -21
- package/types/phaser/core/input.d.ts.map +1 -1
- package/types/phaser/core/input_handler.d.ts +258 -25
- package/types/phaser/core/input_handler.d.ts.map +1 -1
- package/types/phaser/core/input_mouse.d.ts +59 -12
- package/types/phaser/core/input_mouse.d.ts.map +1 -1
- package/types/phaser/core/input_mspointer.d.ts +49 -15
- package/types/phaser/core/input_mspointer.d.ts.map +1 -1
- package/types/phaser/core/input_pointer.d.ts +80 -4
- package/types/phaser/core/input_pointer.d.ts.map +1 -1
- package/types/phaser/core/input_touch.d.ts +52 -15
- package/types/phaser/core/input_touch.d.ts.map +1 -1
- package/types/phaser/core/loader.d.ts +268 -23
- package/types/phaser/core/loader.d.ts.map +1 -1
- package/types/phaser/core/loader_parser.d.ts +0 -4
- package/types/phaser/core/loader_parser.d.ts.map +1 -1
- package/types/phaser/core/raf.d.ts +17 -7
- package/types/phaser/core/raf.d.ts.map +1 -1
- package/types/phaser/core/scale_manager.d.ts +210 -15
- package/types/phaser/core/scale_manager.d.ts.map +1 -1
- package/types/phaser/core/scene.d.ts +21 -5
- package/types/phaser/core/scene.d.ts.map +1 -1
- package/types/phaser/core/scene_manager.d.ts +90 -10
- package/types/phaser/core/scene_manager.d.ts.map +1 -1
- package/types/phaser/core/signal.d.ts +95 -11
- package/types/phaser/core/signal.d.ts.map +1 -1
- package/types/phaser/core/signal_binding.d.ts +35 -6
- package/types/phaser/core/signal_binding.d.ts.map +1 -1
- package/types/phaser/core/sound.d.ts +111 -14
- package/types/phaser/core/sound.d.ts.map +1 -1
- package/types/phaser/core/sound_manager.d.ts +94 -8
- package/types/phaser/core/sound_manager.d.ts.map +1 -1
- package/types/phaser/core/sound_sprite.d.ts +22 -8
- package/types/phaser/core/sound_sprite.d.ts.map +1 -1
- package/types/phaser/core/stage.d.ts +32 -3
- package/types/phaser/core/stage.d.ts.map +1 -1
- package/types/phaser/core/time.d.ts +73 -6
- package/types/phaser/core/time.d.ts.map +1 -1
- package/types/phaser/core/timer.d.ts +103 -2
- package/types/phaser/core/timer.d.ts.map +1 -1
- package/types/phaser/core/timer_event.d.ts +11 -5
- package/types/phaser/core/timer_event.d.ts.map +1 -1
- package/types/phaser/core/tween.d.ts +123 -3
- package/types/phaser/core/tween.d.ts.map +1 -1
- package/types/phaser/core/tween_data.d.ts +42 -3
- package/types/phaser/core/tween_data.d.ts.map +1 -1
- package/types/phaser/core/tween_easing.d.ts +0 -36
- package/types/phaser/core/tween_easing.d.ts.map +1 -1
- package/types/phaser/core/tween_manager.d.ts +49 -2
- package/types/phaser/core/tween_manager.d.ts.map +1 -1
- package/types/phaser/core/world.d.ts +9 -1
- package/types/phaser/core/world.d.ts.map +1 -1
- package/types/phaser/display/bitmap_text.d.ts +89 -12
- package/types/phaser/display/bitmap_text.d.ts.map +1 -1
- package/types/phaser/display/button.d.ts +68 -11
- package/types/phaser/display/button.d.ts.map +1 -1
- package/types/phaser/display/canvas/buffer.d.ts +21 -5
- package/types/phaser/display/canvas/buffer.d.ts.map +1 -1
- package/types/phaser/display/canvas/graphics.d.ts +0 -3
- package/types/phaser/display/canvas/graphics.d.ts.map +1 -1
- package/types/phaser/display/canvas/masker.d.ts +0 -2
- package/types/phaser/display/canvas/masker.d.ts.map +1 -1
- package/types/phaser/display/canvas/pool.d.ts +0 -13
- package/types/phaser/display/canvas/pool.d.ts.map +1 -1
- package/types/phaser/display/canvas/renderer.d.ts +30 -3
- package/types/phaser/display/canvas/renderer.d.ts.map +1 -1
- package/types/phaser/display/canvas/tinter.d.ts +0 -5
- package/types/phaser/display/canvas/tinter.d.ts.map +1 -1
- package/types/phaser/display/canvas/util.d.ts +0 -9
- package/types/phaser/display/canvas/util.d.ts.map +1 -1
- package/types/phaser/display/display_object.d.ts +196 -9
- package/types/phaser/display/display_object.d.ts.map +1 -1
- package/types/phaser/display/graphics.d.ts +142 -16
- package/types/phaser/display/graphics.d.ts.map +1 -1
- package/types/phaser/display/graphics_data.d.ts +15 -1
- package/types/phaser/display/graphics_data.d.ts.map +1 -1
- package/types/phaser/display/graphics_data_util.d.ts +3 -3
- package/types/phaser/display/graphics_data_util.d.ts.map +1 -1
- package/types/phaser/display/group.d.ts +68 -6
- package/types/phaser/display/group.d.ts.map +1 -1
- package/types/phaser/display/image.d.ts +77 -15
- package/types/phaser/display/image.d.ts.map +1 -1
- package/types/phaser/display/sprite_batch.d.ts +4 -4
- package/types/phaser/display/sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/sprite_util.d.ts +0 -5
- package/types/phaser/display/sprite_util.d.ts.map +1 -1
- package/types/phaser/display/text.d.ts +373 -53
- package/types/phaser/display/text.d.ts.map +1 -1
- package/types/phaser/display/webgl/abstract_filter.d.ts +8 -6
- package/types/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
- package/types/phaser/display/webgl/base_texture.d.ts +20 -1
- package/types/phaser/display/webgl/base_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/blend_manager.d.ts +11 -6
- package/types/phaser/display/webgl/blend_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/earcut.d.ts +0 -27
- package/types/phaser/display/webgl/earcut.d.ts.map +1 -1
- package/types/phaser/display/webgl/earcut_node.d.ts +9 -9
- package/types/phaser/display/webgl/earcut_node.d.ts.map +1 -1
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts +33 -6
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/webgl/filter_manager.d.ts +23 -7
- package/types/phaser/display/webgl/filter_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/filter_texture.d.ts +21 -3
- package/types/phaser/display/webgl/filter_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/graphics.d.ts +0 -12
- package/types/phaser/display/webgl/graphics.d.ts.map +1 -1
- package/types/phaser/display/webgl/graphics_data.d.ts +12 -8
- package/types/phaser/display/webgl/graphics_data.d.ts.map +1 -1
- package/types/phaser/display/webgl/mask_manager.d.ts +0 -2
- package/types/phaser/display/webgl/mask_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/render_texture.d.ts +31 -4
- package/types/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/renderer.d.ts +42 -5
- package/types/phaser/display/webgl/renderer.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/complex.d.ts +12 -2
- package/types/phaser/display/webgl/shader/complex.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/fast.d.ts +12 -2
- package/types/phaser/display/webgl/shader/fast.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/normal.d.ts +21 -1
- package/types/phaser/display/webgl/shader/normal.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/primitive.d.ts +12 -2
- package/types/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/strip.d.ts +12 -2
- package/types/phaser/display/webgl/shader/strip.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader_manager.d.ts +20 -5
- package/types/phaser/display/webgl/shader_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/sprite_batch.d.ts +38 -1
- package/types/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/webgl/stencil_manager.d.ts +25 -0
- package/types/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/texture.d.ts +22 -1
- package/types/phaser/display/webgl/texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/texture_util.d.ts +0 -2
- package/types/phaser/display/webgl/texture_util.d.ts.map +1 -1
- package/types/phaser/display/webgl/util.d.ts +0 -10
- package/types/phaser/display/webgl/util.d.ts.map +1 -1
- package/types/phaser/geom/circle.d.ts +130 -10
- package/types/phaser/geom/circle.d.ts.map +1 -1
- package/types/phaser/geom/ellipse.d.ts +42 -6
- package/types/phaser/geom/ellipse.d.ts.map +1 -1
- package/types/phaser/geom/line.d.ts +159 -14
- package/types/phaser/geom/line.d.ts.map +1 -1
- package/types/phaser/geom/matrix.d.ts +84 -12
- package/types/phaser/geom/matrix.d.ts.map +1 -1
- package/types/phaser/geom/point.d.ts +170 -19
- package/types/phaser/geom/point.d.ts.map +1 -1
- package/types/phaser/geom/polygon.d.ts +45 -5
- package/types/phaser/geom/polygon.d.ts.map +1 -1
- package/types/phaser/geom/rectangle.d.ts +253 -21
- package/types/phaser/geom/rectangle.d.ts.map +1 -1
- package/types/phaser/geom/rounded_rectangle.d.ts +11 -2
- package/types/phaser/geom/rounded_rectangle.d.ts.map +1 -1
- package/types/phaser/geom/util/circle.d.ts +3 -10
- package/types/phaser/geom/util/circle.d.ts.map +1 -1
- package/types/phaser/geom/util/ellipse.d.ts +0 -7
- package/types/phaser/geom/util/ellipse.d.ts.map +1 -1
- package/types/phaser/geom/util/line.d.ts +5 -10
- package/types/phaser/geom/util/line.d.ts.map +1 -1
- package/types/phaser/geom/util/matrix.d.ts +0 -3
- package/types/phaser/geom/util/matrix.d.ts.map +1 -1
- package/types/phaser/geom/util/point.d.ts +0 -20
- package/types/phaser/geom/util/point.d.ts.map +1 -1
- package/types/phaser/geom/util/polygon.d.ts +0 -1
- package/types/phaser/geom/util/polygon.d.ts.map +1 -1
- package/types/phaser/geom/util/rectangle.d.ts +0 -16
- package/types/phaser/geom/util/rectangle.d.ts.map +1 -1
- package/types/phaser/geom/util/rounded_rectangle.d.ts +0 -1
- package/types/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
- package/types/phaser/util/math.d.ts +0 -27
- package/types/phaser/util/math.d.ts.map +1 -1
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
3
|
-
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
4
|
-
* @author Richard Davey <rich@photonstorm.com>
|
|
5
|
-
*/
|
|
6
|
-
const NO_BUTTON = -1;
|
|
1
|
+
/* const NO_BUTTON = -1;
|
|
7
2
|
const LEFT_BUTTON = 0;
|
|
8
3
|
const MIDDLE_BUTTON = 1;
|
|
9
4
|
const RIGHT_BUTTON = 2;
|
|
10
5
|
const BACK_BUTTON = 3;
|
|
11
6
|
const FORWARD_BUTTON = 4;
|
|
12
7
|
const WHEEL_UP = 1;
|
|
13
|
-
const WHEEL_DOWN = -1;
|
|
8
|
+
const WHEEL_DOWN = -1; */
|
|
9
|
+
|
|
10
|
+
import { Game } from './game';
|
|
14
11
|
|
|
15
12
|
class WheelEventProxy {
|
|
13
|
+
/**
|
|
14
|
+
* TBD.
|
|
15
|
+
* @param scaleFactor
|
|
16
|
+
* @param deltaMode
|
|
17
|
+
*/
|
|
16
18
|
constructor(scaleFactor, deltaMode) {
|
|
17
19
|
this._scaleFactor = scaleFactor;
|
|
18
20
|
this._deltaMode = deltaMode;
|
|
@@ -21,6 +23,10 @@ class WheelEventProxy {
|
|
|
21
23
|
this.deltaZ = { value: 0 };
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
/**
|
|
27
|
+
* TBD.
|
|
28
|
+
* @param event
|
|
29
|
+
*/
|
|
24
30
|
bindEvent(event) {
|
|
25
31
|
// TODO
|
|
26
32
|
console.warn('input_mouse.bindEvent() is not implemented');
|
|
@@ -39,20 +45,33 @@ class WheelEventProxy {
|
|
|
39
45
|
return this;
|
|
40
46
|
}
|
|
41
47
|
|
|
48
|
+
/**
|
|
49
|
+
* TBD.
|
|
50
|
+
*/
|
|
42
51
|
get deltaMode() {
|
|
43
52
|
return this._deltaMode;
|
|
44
53
|
}
|
|
45
54
|
|
|
55
|
+
/**
|
|
56
|
+
* TBD.
|
|
57
|
+
*/
|
|
46
58
|
get deltaY() {
|
|
47
59
|
return this._scaleFactor * (this.originalEvent.wheelDelta || this.originalEvent.detail) || 0;
|
|
48
60
|
}
|
|
49
61
|
|
|
62
|
+
/**
|
|
63
|
+
* TBD.
|
|
64
|
+
*/
|
|
50
65
|
get deltaX() {
|
|
51
66
|
return this._scaleFactor * this.originalEvent.wheelDeltaX || 0;
|
|
52
67
|
}
|
|
53
68
|
}
|
|
54
69
|
|
|
55
70
|
export class Mouse {
|
|
71
|
+
/**
|
|
72
|
+
* TBD.
|
|
73
|
+
* @param {Game} game - TBD.
|
|
74
|
+
*/
|
|
56
75
|
constructor(game) {
|
|
57
76
|
this.game = game;
|
|
58
77
|
this.input = game.input;
|
|
@@ -78,6 +97,9 @@ export class Mouse {
|
|
|
78
97
|
this._wheelEvent = null;
|
|
79
98
|
}
|
|
80
99
|
|
|
100
|
+
/**
|
|
101
|
+
* TBD.
|
|
102
|
+
*/
|
|
81
103
|
start() {
|
|
82
104
|
if (this.game.device.android && this.game.device.chrome === false) {
|
|
83
105
|
// Android stock browser fires mouse events even if you preventDefault on the touchStart, so ...
|
|
@@ -110,6 +132,9 @@ export class Mouse {
|
|
|
110
132
|
}
|
|
111
133
|
}
|
|
112
134
|
|
|
135
|
+
/**
|
|
136
|
+
* TBD.
|
|
137
|
+
*/
|
|
113
138
|
stop() {
|
|
114
139
|
const canvas = this.game.canvas;
|
|
115
140
|
canvas.removeEventListener('mousedown', this._onMouseDown, true);
|
|
@@ -125,6 +150,10 @@ export class Mouse {
|
|
|
125
150
|
window.removeEventListener('mouseout', this._onMouseOutGlobal, true);
|
|
126
151
|
}
|
|
127
152
|
|
|
153
|
+
/**
|
|
154
|
+
* TBD.
|
|
155
|
+
* @param event
|
|
156
|
+
*/
|
|
128
157
|
onMouseDown(event) {
|
|
129
158
|
this.event = event;
|
|
130
159
|
this.eventPreventDefault(event);
|
|
@@ -138,6 +167,10 @@ export class Mouse {
|
|
|
138
167
|
this.input.mousePointer.start(event);
|
|
139
168
|
}
|
|
140
169
|
|
|
170
|
+
/**
|
|
171
|
+
* TBD.
|
|
172
|
+
* @param event
|
|
173
|
+
*/
|
|
141
174
|
onMouseMove(event) {
|
|
142
175
|
this.event = event;
|
|
143
176
|
this.eventPreventDefault(event);
|
|
@@ -151,6 +184,10 @@ export class Mouse {
|
|
|
151
184
|
this.input.mousePointer.move(event);
|
|
152
185
|
}
|
|
153
186
|
|
|
187
|
+
/**
|
|
188
|
+
* TBD.
|
|
189
|
+
* @param event
|
|
190
|
+
*/
|
|
154
191
|
onMouseUp(event) {
|
|
155
192
|
this.event = event;
|
|
156
193
|
this.eventPreventDefault(event);
|
|
@@ -164,6 +201,10 @@ export class Mouse {
|
|
|
164
201
|
this.input.mousePointer.stop(event);
|
|
165
202
|
}
|
|
166
203
|
|
|
204
|
+
/**
|
|
205
|
+
* TBD.
|
|
206
|
+
* @param event
|
|
207
|
+
*/
|
|
167
208
|
onMouseUpGlobal(event) {
|
|
168
209
|
if (!this.input.mousePointer.withinGame) {
|
|
169
210
|
if (this.mouseUpCallback) {
|
|
@@ -174,6 +215,10 @@ export class Mouse {
|
|
|
174
215
|
}
|
|
175
216
|
}
|
|
176
217
|
|
|
218
|
+
/**
|
|
219
|
+
* TBD.
|
|
220
|
+
* @param event
|
|
221
|
+
*/
|
|
177
222
|
onMouseOutGlobal(event) {
|
|
178
223
|
this.event = event;
|
|
179
224
|
this.eventPreventDefault(event);
|
|
@@ -189,6 +234,10 @@ export class Mouse {
|
|
|
189
234
|
this.input.mousePointer.stop(event);
|
|
190
235
|
}
|
|
191
236
|
|
|
237
|
+
/**
|
|
238
|
+
* TBD.
|
|
239
|
+
* @param event
|
|
240
|
+
*/
|
|
192
241
|
onMouseOut(event) {
|
|
193
242
|
this.event = event;
|
|
194
243
|
this.eventPreventDefault(event);
|
|
@@ -205,6 +254,10 @@ export class Mouse {
|
|
|
205
254
|
}
|
|
206
255
|
}
|
|
207
256
|
|
|
257
|
+
/**
|
|
258
|
+
* TBD.
|
|
259
|
+
* @param event
|
|
260
|
+
*/
|
|
208
261
|
onMouseOver(event) {
|
|
209
262
|
this.event = event;
|
|
210
263
|
this.eventPreventDefault(event);
|
|
@@ -214,6 +267,10 @@ export class Mouse {
|
|
|
214
267
|
}
|
|
215
268
|
}
|
|
216
269
|
|
|
270
|
+
/**
|
|
271
|
+
* TBD.
|
|
272
|
+
* @param event
|
|
273
|
+
*/
|
|
217
274
|
onMouseWheel(event) {
|
|
218
275
|
if (this._wheelEvent) {
|
|
219
276
|
event = this._wheelEvent.bindEvent(event);
|
|
@@ -227,6 +284,10 @@ export class Mouse {
|
|
|
227
284
|
}
|
|
228
285
|
}
|
|
229
286
|
|
|
287
|
+
/**
|
|
288
|
+
* TBD.
|
|
289
|
+
* @param event
|
|
290
|
+
*/
|
|
230
291
|
eventPreventDefault(event) {
|
|
231
292
|
if (this.capture) {
|
|
232
293
|
if (typeof event.cancelable !== 'boolean' || event.cancelable) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
3
|
-
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
4
|
-
* @author Richard Davey <rich@photonstorm.com>
|
|
5
|
-
*/
|
|
1
|
+
import { Game } from './game';
|
|
6
2
|
|
|
7
3
|
export class MSPointer {
|
|
4
|
+
/**
|
|
5
|
+
* TBD.
|
|
6
|
+
* @param {Game} game - TBD.
|
|
7
|
+
*/
|
|
8
8
|
constructor(game) {
|
|
9
9
|
this.game = game;
|
|
10
10
|
this.input = game.input;
|
|
@@ -24,6 +24,9 @@ export class MSPointer {
|
|
|
24
24
|
this._onMSPointerOver = null;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* TBD.
|
|
29
|
+
*/
|
|
27
30
|
start() {
|
|
28
31
|
if (!this.game.device.mspointer || this._onMSPointerDown !== null) {
|
|
29
32
|
return;
|
|
@@ -54,6 +57,9 @@ export class MSPointer {
|
|
|
54
57
|
canvas.addEventListener('pointerout', this._onMSPointerOut, true);
|
|
55
58
|
}
|
|
56
59
|
|
|
60
|
+
/**
|
|
61
|
+
* TBD.
|
|
62
|
+
*/
|
|
57
63
|
stop() {
|
|
58
64
|
if (!this.game.device.mspointer) {
|
|
59
65
|
return;
|
|
@@ -75,6 +81,10 @@ export class MSPointer {
|
|
|
75
81
|
canvas.removeEventListener('pointerout', this._onMSPointerOut, true);
|
|
76
82
|
}
|
|
77
83
|
|
|
84
|
+
/**
|
|
85
|
+
* TBD.
|
|
86
|
+
* @param event
|
|
87
|
+
*/
|
|
78
88
|
onPointerDown(event) {
|
|
79
89
|
this.event = event;
|
|
80
90
|
this.eventPreventDefault(event);
|
|
@@ -92,6 +102,10 @@ export class MSPointer {
|
|
|
92
102
|
}
|
|
93
103
|
}
|
|
94
104
|
|
|
105
|
+
/**
|
|
106
|
+
* TBD.
|
|
107
|
+
* @param event
|
|
108
|
+
*/
|
|
95
109
|
onPointerMove(event) {
|
|
96
110
|
this.event = event;
|
|
97
111
|
this.eventPreventDefault(event);
|
|
@@ -109,6 +123,10 @@ export class MSPointer {
|
|
|
109
123
|
}
|
|
110
124
|
}
|
|
111
125
|
|
|
126
|
+
/**
|
|
127
|
+
* TBD.
|
|
128
|
+
* @param event
|
|
129
|
+
*/
|
|
112
130
|
onPointerUp(event) {
|
|
113
131
|
this.event = event;
|
|
114
132
|
this.eventPreventDefault(event);
|
|
@@ -126,11 +144,12 @@ export class MSPointer {
|
|
|
126
144
|
}
|
|
127
145
|
}
|
|
128
146
|
|
|
147
|
+
/**
|
|
148
|
+
* TBD.
|
|
149
|
+
* @param event
|
|
150
|
+
*/
|
|
129
151
|
onPointerUpGlobal(event) {
|
|
130
|
-
if (
|
|
131
|
-
(event.pointerType === 'mouse' || event.pointerType === 0x00000004) &&
|
|
132
|
-
!this.input.mousePointer.withinGame
|
|
133
|
-
) {
|
|
152
|
+
if ((event.pointerType === 'mouse' || event.pointerType === 0x00000004) && !this.input.mousePointer.withinGame) {
|
|
134
153
|
this.onPointerUp(event);
|
|
135
154
|
} else {
|
|
136
155
|
const pointer = this.input.getPointerFromIdentifier(event.identifier);
|
|
@@ -140,6 +159,10 @@ export class MSPointer {
|
|
|
140
159
|
}
|
|
141
160
|
}
|
|
142
161
|
|
|
162
|
+
/**
|
|
163
|
+
* TBD.
|
|
164
|
+
* @param event
|
|
165
|
+
*/
|
|
143
166
|
onPointerOut(event) {
|
|
144
167
|
this.event = event;
|
|
145
168
|
this.eventPreventDefault(event);
|
|
@@ -168,6 +191,10 @@ export class MSPointer {
|
|
|
168
191
|
}
|
|
169
192
|
}
|
|
170
193
|
|
|
194
|
+
/**
|
|
195
|
+
* TBD.
|
|
196
|
+
* @param event
|
|
197
|
+
*/
|
|
171
198
|
onPointerOver(event) {
|
|
172
199
|
this.event = event;
|
|
173
200
|
this.eventPreventDefault(event);
|
|
@@ -184,6 +211,10 @@ export class MSPointer {
|
|
|
184
211
|
}
|
|
185
212
|
}
|
|
186
213
|
|
|
214
|
+
/**
|
|
215
|
+
* TBD.
|
|
216
|
+
* @param event
|
|
217
|
+
*/
|
|
187
218
|
eventPreventDefault(event) {
|
|
188
219
|
if (this.capture) {
|
|
189
220
|
if (typeof event.cancelable !== 'boolean' || event.cancelable) {
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
3
|
-
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
4
|
-
* @author Richard Davey <rich@photonstorm.com>
|
|
5
|
-
*/
|
|
6
1
|
import { Point } from '../geom/point';
|
|
7
|
-
import { Circle } from
|
|
2
|
+
import { Circle } from '../geom/circle';
|
|
8
3
|
import {
|
|
9
4
|
POINTER,
|
|
10
5
|
POINTER_CURSOR,
|
|
@@ -13,8 +8,15 @@ import {
|
|
|
13
8
|
TOUCH_OVERRIDES_MOUSE,
|
|
14
9
|
MOUSE_TOUCH_COMBINE,
|
|
15
10
|
} from './const';
|
|
11
|
+
import { Game } from './game';
|
|
16
12
|
|
|
17
13
|
export class Pointer {
|
|
14
|
+
/**
|
|
15
|
+
* TBD.
|
|
16
|
+
* @param {Game} game - TBD.
|
|
17
|
+
* @param id
|
|
18
|
+
* @param pointerMode
|
|
19
|
+
*/
|
|
18
20
|
constructor(game, id, pointerMode) {
|
|
19
21
|
this.game = game;
|
|
20
22
|
this.id = id;
|
|
@@ -62,11 +64,18 @@ export class Pointer {
|
|
|
62
64
|
this._trampolineTargetObject = null;
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
/**
|
|
68
|
+
* TBD.
|
|
69
|
+
*/
|
|
65
70
|
resetButtons() {
|
|
66
71
|
this.isDown = false;
|
|
67
72
|
this.isUp = true;
|
|
68
73
|
}
|
|
69
74
|
|
|
75
|
+
/**
|
|
76
|
+
* TBD.
|
|
77
|
+
* @param event
|
|
78
|
+
*/
|
|
70
79
|
updateButtons(event) {
|
|
71
80
|
if (event.type.toLowerCase().substr(-4) === 'down') {
|
|
72
81
|
this.isUp = false;
|
|
@@ -77,6 +86,10 @@ export class Pointer {
|
|
|
77
86
|
}
|
|
78
87
|
}
|
|
79
88
|
|
|
89
|
+
/**
|
|
90
|
+
* TBD.
|
|
91
|
+
* @param event
|
|
92
|
+
*/
|
|
80
93
|
start(event) {
|
|
81
94
|
const input = this.game.input;
|
|
82
95
|
if (event.pointerId) {
|
|
@@ -123,6 +136,9 @@ export class Pointer {
|
|
|
123
136
|
return this;
|
|
124
137
|
}
|
|
125
138
|
|
|
139
|
+
/**
|
|
140
|
+
* TBD.
|
|
141
|
+
*/
|
|
126
142
|
update() {
|
|
127
143
|
const input = this.game.input;
|
|
128
144
|
if (this.active) {
|
|
@@ -157,6 +173,11 @@ export class Pointer {
|
|
|
157
173
|
}
|
|
158
174
|
}
|
|
159
175
|
|
|
176
|
+
/**
|
|
177
|
+
* TBD.
|
|
178
|
+
* @param event
|
|
179
|
+
* @param fromClick
|
|
180
|
+
*/
|
|
160
181
|
move(event, fromClick = false) {
|
|
161
182
|
const input = this.game.input;
|
|
162
183
|
if (input.pollLocked) {
|
|
@@ -202,13 +223,7 @@ export class Pointer {
|
|
|
202
223
|
let i = input.moveCallbacks.length;
|
|
203
224
|
while (i) {
|
|
204
225
|
i -= 1;
|
|
205
|
-
input.moveCallbacks[i].callback.call(
|
|
206
|
-
input.moveCallbacks[i].context,
|
|
207
|
-
this,
|
|
208
|
-
this.x,
|
|
209
|
-
this.y,
|
|
210
|
-
fromClick
|
|
211
|
-
);
|
|
226
|
+
input.moveCallbacks[i].callback.call(input.moveCallbacks[i].context, this, this.x, this.y, fromClick);
|
|
212
227
|
}
|
|
213
228
|
// Easy out if we're dragging something and it still exists
|
|
214
229
|
if (this.targetObject !== null && this.targetObject.isDragged === true) {
|
|
@@ -221,6 +236,10 @@ export class Pointer {
|
|
|
221
236
|
return this;
|
|
222
237
|
}
|
|
223
238
|
|
|
239
|
+
/**
|
|
240
|
+
* TBD.
|
|
241
|
+
* @param fromClick
|
|
242
|
+
*/
|
|
224
243
|
processInteractiveObjects(fromClick = false) {
|
|
225
244
|
// Work out which object is on the top
|
|
226
245
|
let highestRenderOrderID = 0;
|
|
@@ -253,10 +272,7 @@ export class Pointer {
|
|
|
253
272
|
// (A node that was previously checked did not request a pixel-perfect check.)
|
|
254
273
|
currentNode = this.game.input.interactiveItems.first;
|
|
255
274
|
while (currentNode) {
|
|
256
|
-
if (
|
|
257
|
-
!currentNode.checked &&
|
|
258
|
-
currentNode.validForInput(highestInputPriorityID, highestRenderOrderID, true)
|
|
259
|
-
) {
|
|
275
|
+
if (!currentNode.checked && currentNode.validForInput(highestInputPriorityID, highestRenderOrderID, true)) {
|
|
260
276
|
if (
|
|
261
277
|
(fromClick && currentNode.checkPointerDown(this, false)) ||
|
|
262
278
|
(!fromClick && currentNode.checkPointerOver(this, false))
|
|
@@ -281,6 +297,11 @@ export class Pointer {
|
|
|
281
297
|
return this.targetObject !== null;
|
|
282
298
|
}
|
|
283
299
|
|
|
300
|
+
/**
|
|
301
|
+
* TBD.
|
|
302
|
+
* @param newTarget
|
|
303
|
+
* @param silent
|
|
304
|
+
*/
|
|
284
305
|
swapTarget(newTarget, silent = false) {
|
|
285
306
|
// Now we know the top-most item (if any) we can process it
|
|
286
307
|
if (newTarget === null) {
|
|
@@ -308,11 +329,19 @@ export class Pointer {
|
|
|
308
329
|
}
|
|
309
330
|
}
|
|
310
331
|
|
|
332
|
+
/**
|
|
333
|
+
* TBD.
|
|
334
|
+
* @param event
|
|
335
|
+
*/
|
|
311
336
|
leave(event) {
|
|
312
337
|
this.withinGame = false;
|
|
313
338
|
this.move(event, false);
|
|
314
339
|
}
|
|
315
340
|
|
|
341
|
+
/**
|
|
342
|
+
* TBD.
|
|
343
|
+
* @param event
|
|
344
|
+
*/
|
|
316
345
|
stop(event) {
|
|
317
346
|
const input = this.game.input;
|
|
318
347
|
if (this._stateReset && this.withinGame) {
|
|
@@ -364,16 +393,31 @@ export class Pointer {
|
|
|
364
393
|
return this;
|
|
365
394
|
}
|
|
366
395
|
|
|
396
|
+
/**
|
|
397
|
+
* TBD.
|
|
398
|
+
* @param duration - TBD.
|
|
399
|
+
*/
|
|
367
400
|
justPressed(duration) {
|
|
368
401
|
duration = duration || this.game.input.justPressedRate;
|
|
369
402
|
return this.isDown === true && this.timeDown + duration > this.game.time.time;
|
|
370
403
|
}
|
|
371
404
|
|
|
405
|
+
/**
|
|
406
|
+
* TBD.
|
|
407
|
+
* @param duration - TBD.
|
|
408
|
+
*/
|
|
372
409
|
justReleased(duration) {
|
|
373
410
|
duration = duration || this.game.input.justReleasedRate;
|
|
374
411
|
return this.isUp && this.timeUp + duration > this.game.time.time;
|
|
375
412
|
}
|
|
376
413
|
|
|
414
|
+
/**
|
|
415
|
+
* TBD.
|
|
416
|
+
* @param name
|
|
417
|
+
* @param callback - TBD.
|
|
418
|
+
* @param callbackContext
|
|
419
|
+
* @param callbackArgs
|
|
420
|
+
*/
|
|
377
421
|
addClickTrampoline(name, callback, callbackContext, callbackArgs) {
|
|
378
422
|
if (!this.isDown) {
|
|
379
423
|
return;
|
|
@@ -395,6 +439,9 @@ export class Pointer {
|
|
|
395
439
|
});
|
|
396
440
|
}
|
|
397
441
|
|
|
442
|
+
/**
|
|
443
|
+
* TBD.
|
|
444
|
+
*/
|
|
398
445
|
processClickTrampolines() {
|
|
399
446
|
const trampolines = this._clickTrampolines;
|
|
400
447
|
if (!trampolines) {
|
|
@@ -410,6 +457,9 @@ export class Pointer {
|
|
|
410
457
|
this._trampolineTargetObject = null;
|
|
411
458
|
}
|
|
412
459
|
|
|
460
|
+
/**
|
|
461
|
+
* TBD.
|
|
462
|
+
*/
|
|
413
463
|
reset() {
|
|
414
464
|
if (this.isMouse === false) {
|
|
415
465
|
this.active = false;
|
|
@@ -428,11 +478,17 @@ export class Pointer {
|
|
|
428
478
|
this.targetObject = null;
|
|
429
479
|
}
|
|
430
480
|
|
|
481
|
+
/**
|
|
482
|
+
* TBD.
|
|
483
|
+
*/
|
|
431
484
|
resetMovement() {
|
|
432
485
|
this.movementX = 0;
|
|
433
486
|
this.movementY = 0;
|
|
434
487
|
}
|
|
435
488
|
|
|
489
|
+
/**
|
|
490
|
+
* TBD.
|
|
491
|
+
*/
|
|
436
492
|
get duration() {
|
|
437
493
|
if (this.isUp) {
|
|
438
494
|
return -1;
|
|
@@ -440,10 +496,16 @@ export class Pointer {
|
|
|
440
496
|
return this.game.time.time - this.timeDown;
|
|
441
497
|
}
|
|
442
498
|
|
|
499
|
+
/**
|
|
500
|
+
* TBD.
|
|
501
|
+
*/
|
|
443
502
|
get worldX() {
|
|
444
503
|
return this.x;
|
|
445
504
|
}
|
|
446
505
|
|
|
506
|
+
/**
|
|
507
|
+
* TBD.
|
|
508
|
+
*/
|
|
447
509
|
get worldY() {
|
|
448
510
|
return this.y;
|
|
449
511
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
3
|
-
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
4
|
-
* @author Richard Davey <rich@photonstorm.com>
|
|
5
|
-
*/
|
|
1
|
+
import { Game } from './game';
|
|
6
2
|
|
|
7
3
|
export class Touch {
|
|
4
|
+
/**
|
|
5
|
+
* TBD.
|
|
6
|
+
* @param {Game} game - TBD.
|
|
7
|
+
*/
|
|
8
8
|
constructor(game) {
|
|
9
9
|
this.game = game;
|
|
10
10
|
this.enabled = true;
|
|
@@ -26,6 +26,9 @@ export class Touch {
|
|
|
26
26
|
this._onTouchMove = null;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* TBD.
|
|
31
|
+
*/
|
|
29
32
|
start() {
|
|
30
33
|
if (!this.game.device.touch || this._onTouchStart !== null) {
|
|
31
34
|
return;
|
|
@@ -45,6 +48,9 @@ export class Touch {
|
|
|
45
48
|
this.game.canvas.addEventListener('touchleave', this._onTouchLeave, false);
|
|
46
49
|
}
|
|
47
50
|
|
|
51
|
+
/**
|
|
52
|
+
* TBD.
|
|
53
|
+
*/
|
|
48
54
|
stop() {
|
|
49
55
|
if (!this.game.device.touch) {
|
|
50
56
|
return;
|
|
@@ -57,6 +63,9 @@ export class Touch {
|
|
|
57
63
|
this.game.canvas.removeEventListener('touchcancel', this._onTouchCancel);
|
|
58
64
|
}
|
|
59
65
|
|
|
66
|
+
/**
|
|
67
|
+
* TBD.
|
|
68
|
+
*/
|
|
60
69
|
consumeDocumentTouches() {
|
|
61
70
|
this._documentTouchMove = (event) => {
|
|
62
71
|
event.preventDefault();
|
|
@@ -64,6 +73,10 @@ export class Touch {
|
|
|
64
73
|
document.addEventListener('touchmove', this._documentTouchMove, false);
|
|
65
74
|
}
|
|
66
75
|
|
|
76
|
+
/**
|
|
77
|
+
* TBD.
|
|
78
|
+
* @param event
|
|
79
|
+
*/
|
|
67
80
|
onTouchStart(event) {
|
|
68
81
|
this.event = event;
|
|
69
82
|
if (!this.game.input.enabled || !this.enabled) {
|
|
@@ -81,6 +94,10 @@ export class Touch {
|
|
|
81
94
|
}
|
|
82
95
|
}
|
|
83
96
|
|
|
97
|
+
/**
|
|
98
|
+
* TBD.
|
|
99
|
+
* @param event
|
|
100
|
+
*/
|
|
84
101
|
onTouchCancel(event) {
|
|
85
102
|
this.event = event;
|
|
86
103
|
if (this.touchCancelCallback) {
|
|
@@ -97,6 +114,10 @@ export class Touch {
|
|
|
97
114
|
}
|
|
98
115
|
}
|
|
99
116
|
|
|
117
|
+
/**
|
|
118
|
+
* TBD.
|
|
119
|
+
* @param event
|
|
120
|
+
*/
|
|
100
121
|
onTouchEnter(event) {
|
|
101
122
|
this.event = event;
|
|
102
123
|
if (this.touchEnterCallback) {
|
|
@@ -108,6 +129,10 @@ export class Touch {
|
|
|
108
129
|
this.eventPreventDefault(event);
|
|
109
130
|
}
|
|
110
131
|
|
|
132
|
+
/**
|
|
133
|
+
* TBD.
|
|
134
|
+
* @param event
|
|
135
|
+
*/
|
|
111
136
|
onTouchLeave(event) {
|
|
112
137
|
this.event = event;
|
|
113
138
|
if (this.touchLeaveCallback) {
|
|
@@ -116,6 +141,10 @@ export class Touch {
|
|
|
116
141
|
this.eventPreventDefault(event);
|
|
117
142
|
}
|
|
118
143
|
|
|
144
|
+
/**
|
|
145
|
+
* TBD.
|
|
146
|
+
* @param event
|
|
147
|
+
*/
|
|
119
148
|
onTouchMove(event) {
|
|
120
149
|
this.event = event;
|
|
121
150
|
if (this.touchMoveCallback) {
|
|
@@ -127,6 +156,10 @@ export class Touch {
|
|
|
127
156
|
}
|
|
128
157
|
}
|
|
129
158
|
|
|
159
|
+
/**
|
|
160
|
+
* TBD.
|
|
161
|
+
* @param event
|
|
162
|
+
*/
|
|
130
163
|
onTouchEnd(event) {
|
|
131
164
|
this.event = event;
|
|
132
165
|
if (this.touchEndCallback) {
|
|
@@ -141,6 +174,10 @@ export class Touch {
|
|
|
141
174
|
}
|
|
142
175
|
}
|
|
143
176
|
|
|
177
|
+
/**
|
|
178
|
+
* TBD.
|
|
179
|
+
* @param event
|
|
180
|
+
*/
|
|
144
181
|
eventPreventDefault(event) {
|
|
145
182
|
if (this.preventDefault) {
|
|
146
183
|
if (typeof event.cancelable !== 'boolean' || event.cancelable) {
|