@vpmedia/phaser 1.15.0 → 1.17.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 +114 -6
- package/src/phaser/core/animation_manager.js +102 -10
- package/src/phaser/core/animation_parser.js +6 -19
- package/src/phaser/core/array_set.js +59 -5
- package/src/phaser/core/cache.js +307 -6
- package/src/phaser/core/const.js +107 -4
- package/src/phaser/core/device.js +3 -6
- package/src/phaser/core/device_util.js +3 -16
- 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 -12
- package/src/phaser/core/game.js +35 -7
- package/src/phaser/core/input.js +133 -17
- package/src/phaser/core/input_handler.js +243 -43
- package/src/phaser/core/input_mouse.js +70 -5
- package/src/phaser/core/input_mspointer.js +40 -9
- package/src/phaser/core/input_pointer.js +88 -17
- package/src/phaser/core/input_touch.js +42 -5
- package/src/phaser/core/loader.js +303 -101
- package/src/phaser/core/loader_parser.js +2 -10
- 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 -8
- package/src/phaser/core/tween_manager.js +47 -5
- package/src/phaser/core/world.js +9 -6
- package/src/phaser/display/bitmap_text.js +91 -10
- package/src/phaser/display/button.js +63 -12
- package/src/phaser/display/canvas/buffer.js +16 -6
- package/src/phaser/display/canvas/graphics.js +1 -13
- package/src/phaser/display/canvas/masker.js +0 -6
- package/src/phaser/display/canvas/pool.js +0 -7
- package/src/phaser/display/canvas/renderer.js +28 -8
- package/src/phaser/display/canvas/tinter.js +4 -43
- package/src/phaser/display/canvas/util.js +0 -6
- package/src/phaser/display/display_object.js +192 -20
- package/src/phaser/display/graphics.js +161 -26
- package/src/phaser/display/graphics_data.js +14 -6
- package/src/phaser/display/graphics_data_util.js +2 -8
- package/src/phaser/display/group.js +82 -9
- package/src/phaser/display/image.js +87 -9
- package/src/phaser/display/sprite_batch.js +3 -8
- package/src/phaser/display/sprite_util.js +3 -23
- package/src/phaser/display/text.js +331 -31
- 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 -23
- 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 -28
- package/src/phaser/display/webgl/graphics_data.js +10 -7
- package/src/phaser/display/webgl/mask_manager.js +0 -6
- 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 -6
- package/src/phaser/display/webgl/util.js +0 -7
- package/src/phaser/geom/circle.js +123 -18
- package/src/phaser/geom/ellipse.js +39 -18
- package/src/phaser/geom/line.js +148 -16
- package/src/phaser/geom/matrix.js +73 -6
- package/src/phaser/geom/point.js +152 -6
- package/src/phaser/geom/polygon.js +42 -14
- package/src/phaser/geom/rectangle.js +233 -6
- package/src/phaser/geom/rounded_rectangle.js +10 -6
- package/src/phaser/geom/util/circle.js +3 -9
- package/src/phaser/geom/util/ellipse.js +0 -7
- package/src/phaser/geom/util/line.js +5 -14
- package/src/phaser/geom/util/matrix.js +1 -7
- package/src/phaser/geom/util/point.js +0 -6
- package/src/phaser/geom/util/polygon.js +1 -7
- package/src/phaser/geom/util/rectangle.js +1 -7
- package/src/phaser/geom/util/rounded_rectangle.js +1 -7
- package/src/phaser/util/math.js +3 -21
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/phaser/core/animation.d.ts +126 -13
- package/types/phaser/core/animation.d.ts.map +1 -1
- package/types/phaser/core/animation_manager.d.ts +121 -19
- package/types/phaser/core/animation_manager.d.ts.map +1 -1
- package/types/phaser/core/animation_parser.d.ts +6 -5
- package/types/phaser/core/animation_parser.d.ts.map +1 -1
- package/types/phaser/core/array_set.d.ts +67 -13
- package/types/phaser/core/array_set.d.ts.map +1 -1
- package/types/phaser/core/cache.d.ts +365 -69
- 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 +0 -5
- package/types/phaser/core/device.d.ts.map +1 -1
- package/types/phaser/core/device_util.d.ts +1 -1
- package/types/phaser/core/device_util.d.ts.map +1 -1
- package/types/phaser/core/dom.d.ts +119 -0
- package/types/phaser/core/dom.d.ts.map +1 -1
- package/types/phaser/core/event_manager.d.ts +127 -0
- package/types/phaser/core/event_manager.d.ts.map +1 -1
- package/types/phaser/core/factory.d.ts +75 -8
- package/types/phaser/core/factory.d.ts.map +1 -1
- package/types/phaser/core/frame.d.ts +64 -21
- 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 -8
- package/types/phaser/core/frame_util.d.ts.map +1 -1
- package/types/phaser/core/game.d.ts +40 -6
- package/types/phaser/core/game.d.ts.map +1 -1
- package/types/phaser/core/input.d.ts +143 -15
- 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 +62 -14
- package/types/phaser/core/input_mouse.d.ts.map +1 -1
- package/types/phaser/core/input_mspointer.d.ts +51 -17
- package/types/phaser/core/input_mspointer.d.ts.map +1 -1
- package/types/phaser/core/input_pointer.d.ts +99 -14
- package/types/phaser/core/input_pointer.d.ts.map +1 -1
- package/types/phaser/core/input_touch.d.ts +53 -16
- package/types/phaser/core/input_touch.d.ts.map +1 -1
- package/types/phaser/core/loader.d.ts +299 -28
- package/types/phaser/core/loader.d.ts.map +1 -1
- package/types/phaser/core/loader_parser.d.ts.map +1 -1
- package/types/phaser/core/raf.d.ts +19 -9
- package/types/phaser/core/raf.d.ts.map +1 -1
- package/types/phaser/core/scale_manager.d.ts +208 -13
- 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 +93 -9
- package/types/phaser/core/signal.d.ts.map +1 -1
- package/types/phaser/core/signal_binding.d.ts +34 -5
- 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 +97 -11
- 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 +108 -7
- package/types/phaser/core/timer.d.ts.map +1 -1
- package/types/phaser/core/timer_event.d.ts +13 -7
- package/types/phaser/core/timer_event.d.ts.map +1 -1
- package/types/phaser/core/tween.d.ts +124 -4
- package/types/phaser/core/tween.d.ts.map +1 -1
- package/types/phaser/core/tween_data.d.ts +41 -2
- package/types/phaser/core/tween_data.d.ts.map +1 -1
- package/types/phaser/core/tween_easing.d.ts +0 -5
- 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 +84 -7
- package/types/phaser/display/bitmap_text.d.ts.map +1 -1
- package/types/phaser/display/button.d.ts +65 -8
- package/types/phaser/display/button.d.ts.map +1 -1
- package/types/phaser/display/canvas/buffer.d.ts +20 -4
- package/types/phaser/display/canvas/buffer.d.ts.map +1 -1
- package/types/phaser/display/canvas/graphics.d.ts.map +1 -1
- package/types/phaser/display/canvas/masker.d.ts.map +1 -1
- package/types/phaser/display/canvas/pool.d.ts +0 -6
- package/types/phaser/display/canvas/pool.d.ts.map +1 -1
- package/types/phaser/display/canvas/renderer.d.ts +29 -2
- package/types/phaser/display/canvas/renderer.d.ts.map +1 -1
- package/types/phaser/display/canvas/tinter.d.ts.map +1 -1
- package/types/phaser/display/canvas/util.d.ts.map +1 -1
- package/types/phaser/display/display_object.d.ts +195 -8
- package/types/phaser/display/display_object.d.ts.map +1 -1
- package/types/phaser/display/graphics.d.ts +132 -6
- 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 -2
- package/types/phaser/display/graphics_data_util.d.ts.map +1 -1
- package/types/phaser/display/group.d.ts +80 -10
- package/types/phaser/display/group.d.ts.map +1 -1
- package/types/phaser/display/image.d.ts +72 -6
- package/types/phaser/display/image.d.ts.map +1 -1
- package/types/phaser/display/sprite_batch.d.ts +4 -3
- package/types/phaser/display/sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/sprite_util.d.ts.map +1 -1
- package/types/phaser/display/text.d.ts +366 -46
- 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.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 +22 -6
- 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.map +1 -1
- package/types/phaser/display/webgl/graphics_data.d.ts +10 -6
- package/types/phaser/display/webgl/graphics_data.d.ts.map +1 -1
- package/types/phaser/display/webgl/mask_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/render_texture.d.ts +30 -3
- package/types/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/renderer.d.ts +41 -4
- package/types/phaser/display/webgl/renderer.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/complex.d.ts +10 -0
- package/types/phaser/display/webgl/shader/complex.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/fast.d.ts +10 -0
- package/types/phaser/display/webgl/shader/fast.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/normal.d.ts +20 -0
- package/types/phaser/display/webgl/shader/normal.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/primitive.d.ts +10 -0
- package/types/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/strip.d.ts +10 -0
- package/types/phaser/display/webgl/shader/strip.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader_manager.d.ts +15 -0
- package/types/phaser/display/webgl/shader_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/sprite_batch.d.ts +37 -0
- 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 +21 -0
- package/types/phaser/display/webgl/texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/texture_util.d.ts.map +1 -1
- package/types/phaser/display/webgl/util.d.ts +0 -6
- package/types/phaser/display/webgl/util.d.ts.map +1 -1
- package/types/phaser/geom/circle.d.ts +131 -9
- package/types/phaser/geom/circle.d.ts.map +1 -1
- package/types/phaser/geom/ellipse.d.ts +43 -5
- package/types/phaser/geom/ellipse.d.ts.map +1 -1
- package/types/phaser/geom/line.d.ts +159 -13
- package/types/phaser/geom/line.d.ts.map +1 -1
- package/types/phaser/geom/matrix.d.ts +85 -11
- package/types/phaser/geom/matrix.d.ts.map +1 -1
- package/types/phaser/geom/point.d.ts +170 -18
- 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 -20
- package/types/phaser/geom/rectangle.d.ts.map +1 -1
- package/types/phaser/geom/rounded_rectangle.d.ts +11 -1
- package/types/phaser/geom/rounded_rectangle.d.ts.map +1 -1
- package/types/phaser/geom/util/circle.d.ts +3 -3
- package/types/phaser/geom/util/circle.d.ts.map +1 -1
- package/types/phaser/geom/util/ellipse.d.ts +0 -6
- package/types/phaser/geom/util/ellipse.d.ts.map +1 -1
- package/types/phaser/geom/util/line.d.ts +5 -5
- package/types/phaser/geom/util/line.d.ts.map +1 -1
- package/types/phaser/geom/util/matrix.d.ts.map +1 -1
- package/types/phaser/geom/util/point.d.ts.map +1 -1
- package/types/phaser/geom/util/polygon.d.ts.map +1 -1
- package/types/phaser/geom/util/rectangle.d.ts.map +1 -1
- package/types/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
- package/types/phaser/util/math.d.ts +0 -5
- package/types/phaser/util/math.d.ts.map +1 -1
|
@@ -1,8 +1,3 @@
|
|
|
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
|
/* const NO_BUTTON = -1;
|
|
7
2
|
const LEFT_BUTTON = 0;
|
|
8
3
|
const MIDDLE_BUTTON = 1;
|
|
@@ -12,7 +7,14 @@ const FORWARD_BUTTON = 4;
|
|
|
12
7
|
const WHEEL_UP = 1;
|
|
13
8
|
const WHEEL_DOWN = -1; */
|
|
14
9
|
|
|
10
|
+
import { Game } from './game';
|
|
11
|
+
|
|
15
12
|
class WheelEventProxy {
|
|
13
|
+
/**
|
|
14
|
+
* TBD.
|
|
15
|
+
* @param scaleFactor - TBD.
|
|
16
|
+
* @param deltaMode - TBD.
|
|
17
|
+
*/
|
|
16
18
|
constructor(scaleFactor, deltaMode) {
|
|
17
19
|
this._scaleFactor = scaleFactor;
|
|
18
20
|
this._deltaMode = deltaMode;
|
|
@@ -21,6 +23,11 @@ class WheelEventProxy {
|
|
|
21
23
|
this.deltaZ = { value: 0 };
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
/**
|
|
27
|
+
* TBD.
|
|
28
|
+
* @param {WheelEvent} event - TBD.
|
|
29
|
+
* @returns {WheelEventProxy} TBD.
|
|
30
|
+
*/
|
|
24
31
|
bindEvent(event) {
|
|
25
32
|
// TODO
|
|
26
33
|
console.warn('input_mouse.bindEvent() is not implemented');
|
|
@@ -39,20 +46,35 @@ class WheelEventProxy {
|
|
|
39
46
|
return this;
|
|
40
47
|
}
|
|
41
48
|
|
|
49
|
+
/**
|
|
50
|
+
* TBD.
|
|
51
|
+
*/
|
|
42
52
|
get deltaMode() {
|
|
43
53
|
return this._deltaMode;
|
|
44
54
|
}
|
|
45
55
|
|
|
56
|
+
/**
|
|
57
|
+
* TBD.
|
|
58
|
+
* @returns {number} TBD.
|
|
59
|
+
*/
|
|
46
60
|
get deltaY() {
|
|
47
61
|
return this._scaleFactor * (this.originalEvent.wheelDelta || this.originalEvent.detail) || 0;
|
|
48
62
|
}
|
|
49
63
|
|
|
64
|
+
/**
|
|
65
|
+
* TBD.
|
|
66
|
+
* @returns {number} TBD.
|
|
67
|
+
*/
|
|
50
68
|
get deltaX() {
|
|
51
69
|
return this._scaleFactor * this.originalEvent.wheelDeltaX || 0;
|
|
52
70
|
}
|
|
53
71
|
}
|
|
54
72
|
|
|
55
73
|
export class Mouse {
|
|
74
|
+
/**
|
|
75
|
+
* TBD.
|
|
76
|
+
* @param {Game} game - TBD.
|
|
77
|
+
*/
|
|
56
78
|
constructor(game) {
|
|
57
79
|
this.game = game;
|
|
58
80
|
this.input = game.input;
|
|
@@ -62,6 +84,7 @@ export class Mouse {
|
|
|
62
84
|
this.mouseOutCallback = null;
|
|
63
85
|
this.mouseOverCallback = null;
|
|
64
86
|
this.mouseWheelCallback = null;
|
|
87
|
+
this.mouseMoveCallback = null;
|
|
65
88
|
this.capture = false;
|
|
66
89
|
this.button = -1;
|
|
67
90
|
this.wheelDelta = 0;
|
|
@@ -78,6 +101,9 @@ export class Mouse {
|
|
|
78
101
|
this._wheelEvent = null;
|
|
79
102
|
}
|
|
80
103
|
|
|
104
|
+
/**
|
|
105
|
+
* TBD.
|
|
106
|
+
*/
|
|
81
107
|
start() {
|
|
82
108
|
if (this.game.device.android && this.game.device.chrome === false) {
|
|
83
109
|
// Android stock browser fires mouse events even if you preventDefault on the touchStart, so ...
|
|
@@ -110,6 +136,9 @@ export class Mouse {
|
|
|
110
136
|
}
|
|
111
137
|
}
|
|
112
138
|
|
|
139
|
+
/**
|
|
140
|
+
* TBD.
|
|
141
|
+
*/
|
|
113
142
|
stop() {
|
|
114
143
|
const canvas = this.game.canvas;
|
|
115
144
|
canvas.removeEventListener('mousedown', this._onMouseDown, true);
|
|
@@ -125,6 +154,10 @@ export class Mouse {
|
|
|
125
154
|
window.removeEventListener('mouseout', this._onMouseOutGlobal, true);
|
|
126
155
|
}
|
|
127
156
|
|
|
157
|
+
/**
|
|
158
|
+
* TBD.
|
|
159
|
+
* @param {MouseEvent} event - TBD.
|
|
160
|
+
*/
|
|
128
161
|
onMouseDown(event) {
|
|
129
162
|
this.event = event;
|
|
130
163
|
this.eventPreventDefault(event);
|
|
@@ -138,6 +171,10 @@ export class Mouse {
|
|
|
138
171
|
this.input.mousePointer.start(event);
|
|
139
172
|
}
|
|
140
173
|
|
|
174
|
+
/**
|
|
175
|
+
* TBD.
|
|
176
|
+
* @param {MouseEvent} event - TBD.
|
|
177
|
+
*/
|
|
141
178
|
onMouseMove(event) {
|
|
142
179
|
this.event = event;
|
|
143
180
|
this.eventPreventDefault(event);
|
|
@@ -151,6 +188,10 @@ export class Mouse {
|
|
|
151
188
|
this.input.mousePointer.move(event);
|
|
152
189
|
}
|
|
153
190
|
|
|
191
|
+
/**
|
|
192
|
+
* TBD.
|
|
193
|
+
* @param {MouseEvent} event - TBD.
|
|
194
|
+
*/
|
|
154
195
|
onMouseUp(event) {
|
|
155
196
|
this.event = event;
|
|
156
197
|
this.eventPreventDefault(event);
|
|
@@ -164,6 +205,10 @@ export class Mouse {
|
|
|
164
205
|
this.input.mousePointer.stop(event);
|
|
165
206
|
}
|
|
166
207
|
|
|
208
|
+
/**
|
|
209
|
+
* TBD.
|
|
210
|
+
* @param {MouseEvent} event - TBD.
|
|
211
|
+
*/
|
|
167
212
|
onMouseUpGlobal(event) {
|
|
168
213
|
if (!this.input.mousePointer.withinGame) {
|
|
169
214
|
if (this.mouseUpCallback) {
|
|
@@ -174,6 +219,10 @@ export class Mouse {
|
|
|
174
219
|
}
|
|
175
220
|
}
|
|
176
221
|
|
|
222
|
+
/**
|
|
223
|
+
* TBD.
|
|
224
|
+
* @param {MouseEvent} event - TBD.
|
|
225
|
+
*/
|
|
177
226
|
onMouseOutGlobal(event) {
|
|
178
227
|
this.event = event;
|
|
179
228
|
this.eventPreventDefault(event);
|
|
@@ -189,6 +238,10 @@ export class Mouse {
|
|
|
189
238
|
this.input.mousePointer.stop(event);
|
|
190
239
|
}
|
|
191
240
|
|
|
241
|
+
/**
|
|
242
|
+
* TBD.
|
|
243
|
+
* @param {MouseEvent} event - TBD.
|
|
244
|
+
*/
|
|
192
245
|
onMouseOut(event) {
|
|
193
246
|
this.event = event;
|
|
194
247
|
this.eventPreventDefault(event);
|
|
@@ -205,6 +258,10 @@ export class Mouse {
|
|
|
205
258
|
}
|
|
206
259
|
}
|
|
207
260
|
|
|
261
|
+
/**
|
|
262
|
+
* TBD.
|
|
263
|
+
* @param {MouseEvent} event - TBD.
|
|
264
|
+
*/
|
|
208
265
|
onMouseOver(event) {
|
|
209
266
|
this.event = event;
|
|
210
267
|
this.eventPreventDefault(event);
|
|
@@ -214,6 +271,10 @@ export class Mouse {
|
|
|
214
271
|
}
|
|
215
272
|
}
|
|
216
273
|
|
|
274
|
+
/**
|
|
275
|
+
* TBD.
|
|
276
|
+
* @param {WheelEvent} event - TBD.
|
|
277
|
+
*/
|
|
217
278
|
onMouseWheel(event) {
|
|
218
279
|
if (this._wheelEvent) {
|
|
219
280
|
event = this._wheelEvent.bindEvent(event);
|
|
@@ -227,6 +288,10 @@ export class Mouse {
|
|
|
227
288
|
}
|
|
228
289
|
}
|
|
229
290
|
|
|
291
|
+
/**
|
|
292
|
+
* TBD.
|
|
293
|
+
* @param {MouseEvent} event - TBD.
|
|
294
|
+
*/
|
|
230
295
|
eventPreventDefault(event) {
|
|
231
296
|
if (this.capture) {
|
|
232
297
|
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} event - TBD.
|
|
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} event - TBD.
|
|
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} event - TBD.
|
|
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} event - TBD.
|
|
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} event - TBD.
|
|
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} event - TBD.
|
|
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} event - TBD.
|
|
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 {number} id - TBD.
|
|
18
|
+
* @param {number} pointerMode - TBD.
|
|
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 {MouseEvent|PointerEvent} event - TBD.
|
|
78
|
+
*/
|
|
70
79
|
updateButtons(event) {
|
|
71
80
|
if (event.type.toLowerCase().substr(-4) === 'down') {
|
|
72
81
|
this.isUp = false;
|
|
@@ -77,6 +86,11 @@ export class Pointer {
|
|
|
77
86
|
}
|
|
78
87
|
}
|
|
79
88
|
|
|
89
|
+
/**
|
|
90
|
+
* TBD.
|
|
91
|
+
* @param {PointerEvent} event - TBD.
|
|
92
|
+
* @returns {Pointer} TBD.
|
|
93
|
+
*/
|
|
80
94
|
start(event) {
|
|
81
95
|
const input = this.game.input;
|
|
82
96
|
if (event.pointerId) {
|
|
@@ -123,6 +137,9 @@ export class Pointer {
|
|
|
123
137
|
return this;
|
|
124
138
|
}
|
|
125
139
|
|
|
140
|
+
/**
|
|
141
|
+
* TBD.
|
|
142
|
+
*/
|
|
126
143
|
update() {
|
|
127
144
|
const input = this.game.input;
|
|
128
145
|
if (this.active) {
|
|
@@ -157,6 +174,12 @@ export class Pointer {
|
|
|
157
174
|
}
|
|
158
175
|
}
|
|
159
176
|
|
|
177
|
+
/**
|
|
178
|
+
* TBD.
|
|
179
|
+
* @param {MouseEvent|PointerEvent} event - TBD.
|
|
180
|
+
* @param {boolean} fromClick - TBD.
|
|
181
|
+
* @returns {Pointer} TBD.
|
|
182
|
+
*/
|
|
160
183
|
move(event, fromClick = false) {
|
|
161
184
|
const input = this.game.input;
|
|
162
185
|
if (input.pollLocked) {
|
|
@@ -202,13 +225,7 @@ export class Pointer {
|
|
|
202
225
|
let i = input.moveCallbacks.length;
|
|
203
226
|
while (i) {
|
|
204
227
|
i -= 1;
|
|
205
|
-
input.moveCallbacks[i].callback.call(
|
|
206
|
-
input.moveCallbacks[i].context,
|
|
207
|
-
this,
|
|
208
|
-
this.x,
|
|
209
|
-
this.y,
|
|
210
|
-
fromClick
|
|
211
|
-
);
|
|
228
|
+
input.moveCallbacks[i].callback.call(input.moveCallbacks[i].context, this, this.x, this.y, fromClick);
|
|
212
229
|
}
|
|
213
230
|
// Easy out if we're dragging something and it still exists
|
|
214
231
|
if (this.targetObject !== null && this.targetObject.isDragged === true) {
|
|
@@ -221,6 +238,11 @@ export class Pointer {
|
|
|
221
238
|
return this;
|
|
222
239
|
}
|
|
223
240
|
|
|
241
|
+
/**
|
|
242
|
+
* TBD.
|
|
243
|
+
* @param {boolean} fromClick - TBD.
|
|
244
|
+
* @returns {boolean} TBD.
|
|
245
|
+
*/
|
|
224
246
|
processInteractiveObjects(fromClick = false) {
|
|
225
247
|
// Work out which object is on the top
|
|
226
248
|
let highestRenderOrderID = 0;
|
|
@@ -253,10 +275,7 @@ export class Pointer {
|
|
|
253
275
|
// (A node that was previously checked did not request a pixel-perfect check.)
|
|
254
276
|
currentNode = this.game.input.interactiveItems.first;
|
|
255
277
|
while (currentNode) {
|
|
256
|
-
if (
|
|
257
|
-
!currentNode.checked &&
|
|
258
|
-
currentNode.validForInput(highestInputPriorityID, highestRenderOrderID, true)
|
|
259
|
-
) {
|
|
278
|
+
if (!currentNode.checked && currentNode.validForInput(highestInputPriorityID, highestRenderOrderID, true)) {
|
|
260
279
|
if (
|
|
261
280
|
(fromClick && currentNode.checkPointerDown(this, false)) ||
|
|
262
281
|
(!fromClick && currentNode.checkPointerOver(this, false))
|
|
@@ -281,6 +300,11 @@ export class Pointer {
|
|
|
281
300
|
return this.targetObject !== null;
|
|
282
301
|
}
|
|
283
302
|
|
|
303
|
+
/**
|
|
304
|
+
* TBD.
|
|
305
|
+
* @param newTarget - TBD.
|
|
306
|
+
* @param {boolean} silent - TBD.
|
|
307
|
+
*/
|
|
284
308
|
swapTarget(newTarget, silent = false) {
|
|
285
309
|
// Now we know the top-most item (if any) we can process it
|
|
286
310
|
if (newTarget === null) {
|
|
@@ -308,11 +332,20 @@ export class Pointer {
|
|
|
308
332
|
}
|
|
309
333
|
}
|
|
310
334
|
|
|
335
|
+
/**
|
|
336
|
+
* TBD.
|
|
337
|
+
* @param {MouseEvent|PointerEvent} event - TBD.
|
|
338
|
+
*/
|
|
311
339
|
leave(event) {
|
|
312
340
|
this.withinGame = false;
|
|
313
341
|
this.move(event, false);
|
|
314
342
|
}
|
|
315
343
|
|
|
344
|
+
/**
|
|
345
|
+
* TBD.
|
|
346
|
+
* @param {MouseEvent|PointerEvent} event - TBD.
|
|
347
|
+
* @returns {Pointer} TBD.
|
|
348
|
+
*/
|
|
316
349
|
stop(event) {
|
|
317
350
|
const input = this.game.input;
|
|
318
351
|
if (this._stateReset && this.withinGame) {
|
|
@@ -364,16 +397,33 @@ export class Pointer {
|
|
|
364
397
|
return this;
|
|
365
398
|
}
|
|
366
399
|
|
|
400
|
+
/**
|
|
401
|
+
* TBD.
|
|
402
|
+
* @param {number} duration - TBD.
|
|
403
|
+
* @returns {boolean} TBD.
|
|
404
|
+
*/
|
|
367
405
|
justPressed(duration) {
|
|
368
406
|
duration = duration || this.game.input.justPressedRate;
|
|
369
407
|
return this.isDown === true && this.timeDown + duration > this.game.time.time;
|
|
370
408
|
}
|
|
371
409
|
|
|
410
|
+
/**
|
|
411
|
+
* TBD.
|
|
412
|
+
* @param {number} duration - TBD.
|
|
413
|
+
* @returns {boolean} TBD.
|
|
414
|
+
*/
|
|
372
415
|
justReleased(duration) {
|
|
373
416
|
duration = duration || this.game.input.justReleasedRate;
|
|
374
417
|
return this.isUp && this.timeUp + duration > this.game.time.time;
|
|
375
418
|
}
|
|
376
419
|
|
|
420
|
+
/**
|
|
421
|
+
* TBD.
|
|
422
|
+
* @param {string} name - TBD.
|
|
423
|
+
* @param {Function} callback - TBD.
|
|
424
|
+
* @param {object} callbackContext - TBD.
|
|
425
|
+
* @param callbackArgs - TBD.
|
|
426
|
+
*/
|
|
377
427
|
addClickTrampoline(name, callback, callbackContext, callbackArgs) {
|
|
378
428
|
if (!this.isDown) {
|
|
379
429
|
return;
|
|
@@ -395,6 +445,9 @@ export class Pointer {
|
|
|
395
445
|
});
|
|
396
446
|
}
|
|
397
447
|
|
|
448
|
+
/**
|
|
449
|
+
* TBD.
|
|
450
|
+
*/
|
|
398
451
|
processClickTrampolines() {
|
|
399
452
|
const trampolines = this._clickTrampolines;
|
|
400
453
|
if (!trampolines) {
|
|
@@ -410,6 +463,9 @@ export class Pointer {
|
|
|
410
463
|
this._trampolineTargetObject = null;
|
|
411
464
|
}
|
|
412
465
|
|
|
466
|
+
/**
|
|
467
|
+
* TBD.
|
|
468
|
+
*/
|
|
413
469
|
reset() {
|
|
414
470
|
if (this.isMouse === false) {
|
|
415
471
|
this.active = false;
|
|
@@ -428,11 +484,18 @@ export class Pointer {
|
|
|
428
484
|
this.targetObject = null;
|
|
429
485
|
}
|
|
430
486
|
|
|
487
|
+
/**
|
|
488
|
+
* TBD.
|
|
489
|
+
*/
|
|
431
490
|
resetMovement() {
|
|
432
491
|
this.movementX = 0;
|
|
433
492
|
this.movementY = 0;
|
|
434
493
|
}
|
|
435
494
|
|
|
495
|
+
/**
|
|
496
|
+
* TBD.
|
|
497
|
+
* @returns {number} TBD.
|
|
498
|
+
*/
|
|
436
499
|
get duration() {
|
|
437
500
|
if (this.isUp) {
|
|
438
501
|
return -1;
|
|
@@ -440,10 +503,18 @@ export class Pointer {
|
|
|
440
503
|
return this.game.time.time - this.timeDown;
|
|
441
504
|
}
|
|
442
505
|
|
|
506
|
+
/**
|
|
507
|
+
* TBD.
|
|
508
|
+
* @returns {number} TBD.
|
|
509
|
+
*/
|
|
443
510
|
get worldX() {
|
|
444
511
|
return this.x;
|
|
445
512
|
}
|
|
446
513
|
|
|
514
|
+
/**
|
|
515
|
+
* TBD.
|
|
516
|
+
* @returns {number} TBD.
|
|
517
|
+
*/
|
|
447
518
|
get worldY() {
|
|
448
519
|
return this.y;
|
|
449
520
|
}
|
|
@@ -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 {TouchEvent} event - TBD.
|
|
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 {TouchEvent} event - TBD.
|
|
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 {TouchEvent} event - TBD.
|
|
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 {TouchEvent} event - TBD.
|
|
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 {TouchEvent} event - TBD.
|
|
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 {TouchEvent} event - TBD.
|
|
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 {TouchEvent} event - TBD.
|
|
180
|
+
*/
|
|
144
181
|
eventPreventDefault(event) {
|
|
145
182
|
if (this.preventDefault) {
|
|
146
183
|
if (typeof event.cancelable !== 'boolean' || event.cancelable) {
|