@vpmedia/phaser 1.17.0 → 1.18.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 +3 -3
- package/src/phaser/core/animation.js +3 -2
- package/src/phaser/core/animation_manager.js +3 -2
- package/src/phaser/core/cache.js +1 -1
- package/src/phaser/core/const.js +66 -0
- package/src/phaser/core/device.js +87 -0
- package/src/phaser/core/dom.js +13 -8
- package/src/phaser/core/event_manager.js +2 -1
- package/src/phaser/core/factory.js +11 -11
- package/src/phaser/core/game.js +1 -0
- package/src/phaser/core/input_mspointer.js +6 -6
- package/src/phaser/core/input_pointer.js +1 -1
- package/src/phaser/core/scale_manager.js +41 -24
- package/src/phaser/core/scene_manager.js +10 -6
- package/src/phaser/core/sound_manager.js +14 -7
- package/src/phaser/core/sound_sprite.js +7 -4
- package/src/phaser/core/timer.js +33 -21
- package/src/phaser/core/timer_event.js +8 -6
- package/src/phaser/core/tween.js +65 -45
- package/src/phaser/core/tween_data.js +22 -15
- package/src/phaser/core/tween_manager.js +10 -6
- package/src/phaser/display/bitmap_text.js +7 -6
- package/src/phaser/display/canvas/pool.js +1 -1
- package/src/phaser/display/canvas/renderer.js +5 -4
- package/src/phaser/display/canvas/util.js +2 -2
- package/src/phaser/display/display_object.js +33 -16
- package/src/phaser/display/graphics.js +57 -36
- package/src/phaser/display/graphics_data.js +7 -7
- package/src/phaser/display/image.js +16 -11
- package/src/phaser/display/sprite_util.js +3 -2
- package/src/phaser/display/text.js +27 -14
- package/src/phaser/display/webgl/abstract_filter.js +2 -2
- package/src/phaser/display/webgl/base_texture.js +2 -2
- package/src/phaser/display/webgl/blend_manager.js +3 -2
- package/src/phaser/display/webgl/earcut_node.js +1 -1
- package/src/phaser/display/webgl/fast_sprite_batch.js +6 -6
- package/src/phaser/display/webgl/filter_manager.js +1 -1
- package/src/phaser/display/webgl/filter_texture.js +2 -2
- package/src/phaser/display/webgl/graphics_data.js +1 -1
- package/src/phaser/display/webgl/render_texture.js +7 -3
- package/src/phaser/display/webgl/renderer.js +9 -6
- package/src/phaser/display/webgl/shader/complex.js +1 -1
- package/src/phaser/display/webgl/shader/fast.js +1 -1
- package/src/phaser/display/webgl/shader/normal.js +2 -2
- package/src/phaser/display/webgl/shader/primitive.js +1 -1
- package/src/phaser/display/webgl/shader/strip.js +1 -1
- package/src/phaser/display/webgl/shader_manager.js +3 -3
- package/src/phaser/display/webgl/sprite_batch.js +9 -7
- package/src/phaser/display/webgl/stencil_manager.js +7 -7
- package/src/phaser/display/webgl/texture.js +8 -6
- package/types/phaser/core/animation.d.ts +5 -4
- package/types/phaser/core/animation.d.ts.map +1 -1
- package/types/phaser/core/animation_manager.d.ts +7 -6
- package/types/phaser/core/animation_manager.d.ts.map +1 -1
- package/types/phaser/core/cache.d.ts +2 -2
- package/types/phaser/core/cache.d.ts.map +1 -1
- package/types/phaser/core/const.d.ts +88 -22
- package/types/phaser/core/const.d.ts.map +1 -1
- package/types/phaser/core/device.d.ts +87 -0
- package/types/phaser/core/device.d.ts.map +1 -1
- package/types/phaser/core/dom.d.ts +19 -27
- package/types/phaser/core/dom.d.ts.map +1 -1
- package/types/phaser/core/event_manager.d.ts +4 -3
- package/types/phaser/core/event_manager.d.ts.map +1 -1
- package/types/phaser/core/factory.d.ts +15 -15
- package/types/phaser/core/factory.d.ts.map +1 -1
- package/types/phaser/core/game.d.ts +1 -0
- package/types/phaser/core/game.d.ts.map +1 -1
- package/types/phaser/core/input.d.ts +2 -2
- package/types/phaser/core/input.d.ts.map +1 -1
- package/types/phaser/core/input_mspointer.d.ts +13 -13
- package/types/phaser/core/input_mspointer.d.ts.map +1 -1
- package/types/phaser/core/input_pointer.d.ts +2 -2
- package/types/phaser/core/input_pointer.d.ts.map +1 -1
- package/types/phaser/core/scale_manager.d.ts +57 -40
- package/types/phaser/core/scale_manager.d.ts.map +1 -1
- package/types/phaser/core/scene_manager.d.ts +15 -10
- package/types/phaser/core/scene_manager.d.ts.map +1 -1
- package/types/phaser/core/sound_manager.d.ts +16 -9
- package/types/phaser/core/sound_manager.d.ts.map +1 -1
- package/types/phaser/core/sound_sprite.d.ts +10 -7
- package/types/phaser/core/sound_sprite.d.ts.map +1 -1
- package/types/phaser/core/timer.d.ts +41 -29
- package/types/phaser/core/timer.d.ts.map +1 -1
- package/types/phaser/core/timer_event.d.ts +12 -11
- package/types/phaser/core/timer_event.d.ts.map +1 -1
- package/types/phaser/core/tween.d.ts +79 -59
- package/types/phaser/core/tween.d.ts.map +1 -1
- package/types/phaser/core/tween_data.d.ts +26 -19
- package/types/phaser/core/tween_data.d.ts.map +1 -1
- package/types/phaser/core/tween_manager.d.ts +16 -12
- package/types/phaser/core/tween_manager.d.ts.map +1 -1
- package/types/phaser/display/bitmap_text.d.ts +10 -9
- package/types/phaser/display/bitmap_text.d.ts.map +1 -1
- package/types/phaser/display/canvas/buffer.d.ts +2 -2
- package/types/phaser/display/canvas/buffer.d.ts.map +1 -1
- package/types/phaser/display/canvas/pool.d.ts +2 -2
- package/types/phaser/display/canvas/pool.d.ts.map +1 -1
- package/types/phaser/display/canvas/renderer.d.ts +5 -4
- package/types/phaser/display/canvas/renderer.d.ts.map +1 -1
- package/types/phaser/display/canvas/util.d.ts +2 -2
- package/types/phaser/display/canvas/util.d.ts.map +1 -1
- package/types/phaser/display/display_object.d.ts +50 -33
- package/types/phaser/display/display_object.d.ts.map +1 -1
- package/types/phaser/display/graphics.d.ts +65 -47
- package/types/phaser/display/graphics.d.ts.map +1 -1
- package/types/phaser/display/graphics_data.d.ts +16 -16
- package/types/phaser/display/graphics_data.d.ts.map +1 -1
- package/types/phaser/display/image.d.ts +17 -18
- package/types/phaser/display/image.d.ts.map +1 -1
- package/types/phaser/display/sprite_util.d.ts +5 -4
- package/types/phaser/display/sprite_util.d.ts.map +1 -1
- package/types/phaser/display/text.d.ts +33 -55
- package/types/phaser/display/text.d.ts.map +1 -1
- package/types/phaser/display/webgl/abstract_filter.d.ts +3 -3
- package/types/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
- package/types/phaser/display/webgl/base_texture.d.ts +4 -4
- package/types/phaser/display/webgl/base_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/blend_manager.d.ts +6 -5
- package/types/phaser/display/webgl/blend_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/earcut_node.d.ts +3 -3
- package/types/phaser/display/webgl/earcut_node.d.ts.map +1 -1
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts +12 -12
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/webgl/filter_manager.d.ts +3 -3
- package/types/phaser/display/webgl/filter_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/filter_texture.d.ts +7 -7
- package/types/phaser/display/webgl/filter_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/graphics_data.d.ts +5 -5
- package/types/phaser/display/webgl/graphics_data.d.ts.map +1 -1
- package/types/phaser/display/webgl/render_texture.d.ts +9 -9
- package/types/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/renderer.d.ts +10 -7
- package/types/phaser/display/webgl/renderer.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/complex.d.ts +11 -11
- package/types/phaser/display/webgl/shader/complex.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/fast.d.ts +15 -15
- package/types/phaser/display/webgl/shader/fast.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/normal.d.ts +11 -11
- package/types/phaser/display/webgl/shader/normal.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/primitive.d.ts +12 -12
- package/types/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/strip.d.ts +12 -12
- package/types/phaser/display/webgl/shader/strip.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader_manager.d.ts +5 -5
- package/types/phaser/display/webgl/shader_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/sprite_batch.d.ts +16 -14
- package/types/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/webgl/stencil_manager.d.ts +12 -12
- package/types/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/texture.d.ts +15 -12
- package/types/phaser/display/webgl/texture.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @vpmedia/phaser
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/js/@vpmedia%2Fphaser)
|
|
4
4
|
[](https://github.com/vpmedia/phaser/actions/workflows/node.js.yml)
|
|
5
5
|
|
|
6
6
|
@vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpmedia/phaser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"description": "@vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2",
|
|
5
5
|
"author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"main": "./src/index.js",
|
|
23
23
|
"types": "./types/index.d.ts",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"eslint": "^8.
|
|
25
|
+
"eslint": "^8.39.0",
|
|
26
26
|
"eslint-config-prettier": "^8.8.0",
|
|
27
27
|
"eslint-plugin-import": "^2.27.5",
|
|
28
28
|
"eslint-plugin-jest": "^27.2.1",
|
|
29
|
-
"eslint-plugin-jsdoc": "^43.0.
|
|
29
|
+
"eslint-plugin-jsdoc": "^43.0.7",
|
|
30
30
|
"eslint-plugin-prettier": "^4.2.1",
|
|
31
31
|
"husky": "^8.0.3",
|
|
32
32
|
"jest": "^29.5.0",
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Game } from './game';
|
|
2
2
|
import { Signal } from './signal';
|
|
3
3
|
import { FrameData } from './frame_data';
|
|
4
|
+
import { Image } from '../display/image';
|
|
4
5
|
|
|
5
6
|
export class Animation {
|
|
6
7
|
/**
|
|
7
8
|
* TBD.
|
|
8
9
|
* @param {Game} game - TBD.
|
|
9
|
-
* @param parent - TBD.
|
|
10
|
+
* @param {Image} parent - TBD.
|
|
10
11
|
* @param {string} name - TBD.
|
|
11
12
|
* @param {FrameData} frameData - TBD.
|
|
12
|
-
* @param frames - TBD.
|
|
13
|
+
* @param {string[]|number[]} frames - TBD.
|
|
13
14
|
* @param {number} frameRate - TBD.
|
|
14
15
|
* @param {boolean} loop - TBD.
|
|
15
16
|
*/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Animation } from './animation';
|
|
2
2
|
import { FrameData } from './frame_data';
|
|
3
|
+
import { Image } from '../display/image';
|
|
3
4
|
|
|
4
5
|
export class AnimationManager {
|
|
5
6
|
/**
|
|
6
7
|
* TBD.
|
|
7
|
-
* @param sprite - TBD.
|
|
8
|
+
* @param {Image} sprite - TBD.
|
|
8
9
|
*/
|
|
9
10
|
constructor(sprite) {
|
|
10
11
|
this.sprite = sprite;
|
|
@@ -131,7 +132,7 @@ export class AnimationManager {
|
|
|
131
132
|
|
|
132
133
|
/**
|
|
133
134
|
* TBD.
|
|
134
|
-
* @param {number[]} frames - TBD.
|
|
135
|
+
* @param {string[]|number[]} frames - TBD.
|
|
135
136
|
* @param {boolean} useNumericIndex - TBD.
|
|
136
137
|
* @returns {boolean} TBD.
|
|
137
138
|
*/
|
package/src/phaser/core/cache.js
CHANGED
|
@@ -113,7 +113,7 @@ export class Cache {
|
|
|
113
113
|
* @param {string} key - TBD.
|
|
114
114
|
* @param {string} url - TBD.
|
|
115
115
|
* @param data - TBD.
|
|
116
|
-
* @param atlasData - TBD.
|
|
116
|
+
* @param {object} atlasData - TBD.
|
|
117
117
|
*/
|
|
118
118
|
addTextureAtlas(key, url, data, atlasData) {
|
|
119
119
|
const obj = {
|
package/src/phaser/core/const.js
CHANGED
|
@@ -169,25 +169,91 @@ export const TOUCH_OVERRIDES_MOUSE = 1;
|
|
|
169
169
|
*/
|
|
170
170
|
export const MOUSE_TOUCH_COMBINE = 2;
|
|
171
171
|
// game objects
|
|
172
|
+
/**
|
|
173
|
+
* @type {number}
|
|
174
|
+
*/
|
|
172
175
|
export const GROUP = 7;
|
|
176
|
+
/**
|
|
177
|
+
* @type {number}
|
|
178
|
+
*/
|
|
173
179
|
export const SPRITE = 0;
|
|
180
|
+
/**
|
|
181
|
+
* @type {number}
|
|
182
|
+
*/
|
|
174
183
|
export const SPRITE_BATCH = 17;
|
|
184
|
+
/**
|
|
185
|
+
* @type {number}
|
|
186
|
+
*/
|
|
175
187
|
export const BUTTON = 1;
|
|
188
|
+
/**
|
|
189
|
+
* @type {number}
|
|
190
|
+
*/
|
|
176
191
|
export const IMAGE = 2;
|
|
192
|
+
/**
|
|
193
|
+
* @type {number}
|
|
194
|
+
*/
|
|
177
195
|
export const GRAPHICS = 3;
|
|
196
|
+
/**
|
|
197
|
+
* @type {number}
|
|
198
|
+
*/
|
|
178
199
|
export const TEXT = 4;
|
|
200
|
+
/**
|
|
201
|
+
* @type {number}
|
|
202
|
+
*/
|
|
179
203
|
export const BITMAP_TEXT = 6;
|
|
204
|
+
/**
|
|
205
|
+
* @type {number}
|
|
206
|
+
*/
|
|
180
207
|
export const TILE_SPRITE = 5;
|
|
208
|
+
/**
|
|
209
|
+
* @type {number}
|
|
210
|
+
*/
|
|
181
211
|
export const RENDER_TEXTURE = 8;
|
|
212
|
+
/**
|
|
213
|
+
* @type {number}
|
|
214
|
+
*/
|
|
182
215
|
export const FILTER_CANVAS = 14;
|
|
216
|
+
/**
|
|
217
|
+
* @type {number}
|
|
218
|
+
*/
|
|
183
219
|
export const FILTER_WEBGL = 15;
|
|
220
|
+
/**
|
|
221
|
+
* @type {number}
|
|
222
|
+
*/
|
|
184
223
|
export const POINTER = 19;
|
|
224
|
+
/**
|
|
225
|
+
* @type {number}
|
|
226
|
+
*/
|
|
185
227
|
export const GEOM_POLYGON = 12;
|
|
228
|
+
/**
|
|
229
|
+
* @type {number}
|
|
230
|
+
*/
|
|
186
231
|
export const GEOM_RECTANGLE = 22;
|
|
232
|
+
/**
|
|
233
|
+
* @type {number}
|
|
234
|
+
*/
|
|
187
235
|
export const GEOM_CIRCLE = 21;
|
|
236
|
+
/**
|
|
237
|
+
* @type {number}
|
|
238
|
+
*/
|
|
188
239
|
export const GEOM_ELLIPSE = 16;
|
|
240
|
+
/**
|
|
241
|
+
* @type {number}
|
|
242
|
+
*/
|
|
189
243
|
export const GEOM_ROUNDED_RECTANGLE = 26;
|
|
244
|
+
/**
|
|
245
|
+
* @type {number}
|
|
246
|
+
*/
|
|
190
247
|
export const GEOM_LINE = 23;
|
|
248
|
+
/**
|
|
249
|
+
* @type {number}
|
|
250
|
+
*/
|
|
191
251
|
export const GEOM_MATRIX = 24;
|
|
252
|
+
/**
|
|
253
|
+
* @type {number}
|
|
254
|
+
*/
|
|
192
255
|
export const GEOM_POINT = 25;
|
|
256
|
+
/**
|
|
257
|
+
* @type {number}
|
|
258
|
+
*/
|
|
193
259
|
export const PENDING_ATLAS = -1;
|
|
@@ -3,35 +3,122 @@ export class Device {
|
|
|
3
3
|
* TBD.
|
|
4
4
|
*/
|
|
5
5
|
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* @type {boolean}
|
|
8
|
+
*/
|
|
6
9
|
this.desktop = false;
|
|
10
|
+
/**
|
|
11
|
+
* @type {boolean}
|
|
12
|
+
*/
|
|
7
13
|
this.iOS = false;
|
|
14
|
+
/**
|
|
15
|
+
* @type {boolean}
|
|
16
|
+
*/
|
|
8
17
|
this.android = false;
|
|
18
|
+
/**
|
|
19
|
+
* @type {boolean}
|
|
20
|
+
*/
|
|
9
21
|
this.chromeOS = false;
|
|
22
|
+
/**
|
|
23
|
+
* @type {boolean}
|
|
24
|
+
*/
|
|
10
25
|
this.linux = false;
|
|
26
|
+
/**
|
|
27
|
+
* @type {boolean}
|
|
28
|
+
*/
|
|
11
29
|
this.macOS = false;
|
|
30
|
+
/**
|
|
31
|
+
* @type {boolean}
|
|
32
|
+
*/
|
|
12
33
|
this.windows = false;
|
|
34
|
+
/**
|
|
35
|
+
* @type {boolean}
|
|
36
|
+
*/
|
|
13
37
|
this.windowsPhone = false;
|
|
38
|
+
/**
|
|
39
|
+
* @type {boolean}
|
|
40
|
+
*/
|
|
14
41
|
this.canvas = false;
|
|
42
|
+
/**
|
|
43
|
+
* @type {boolean}
|
|
44
|
+
*/
|
|
15
45
|
this.touch = false;
|
|
46
|
+
/**
|
|
47
|
+
* @type {boolean}
|
|
48
|
+
*/
|
|
16
49
|
this.mspointer = false;
|
|
17
50
|
this.wheelEvent = null;
|
|
51
|
+
/**
|
|
52
|
+
* @type {boolean}
|
|
53
|
+
*/
|
|
18
54
|
this.chrome = false;
|
|
55
|
+
/**
|
|
56
|
+
* @type {boolean}
|
|
57
|
+
*/
|
|
19
58
|
this.firefox = false;
|
|
59
|
+
/**
|
|
60
|
+
* @type {boolean}
|
|
61
|
+
*/
|
|
20
62
|
this.edge = false;
|
|
63
|
+
/**
|
|
64
|
+
* @type {boolean}
|
|
65
|
+
*/
|
|
21
66
|
this.safari = false;
|
|
67
|
+
/**
|
|
68
|
+
* @type {boolean}
|
|
69
|
+
*/
|
|
22
70
|
this.silk = false;
|
|
71
|
+
/**
|
|
72
|
+
* @type {boolean}
|
|
73
|
+
*/
|
|
23
74
|
this.ogg = false;
|
|
75
|
+
/**
|
|
76
|
+
* @type {boolean}
|
|
77
|
+
*/
|
|
24
78
|
this.opus = false;
|
|
79
|
+
/**
|
|
80
|
+
* @type {boolean}
|
|
81
|
+
*/
|
|
25
82
|
this.mp3 = false;
|
|
83
|
+
/**
|
|
84
|
+
* @type {boolean}
|
|
85
|
+
*/
|
|
26
86
|
this.wav = false;
|
|
87
|
+
/**
|
|
88
|
+
* @type {boolean}
|
|
89
|
+
*/
|
|
27
90
|
this.m4a = false;
|
|
91
|
+
/**
|
|
92
|
+
* @type {boolean}
|
|
93
|
+
*/
|
|
28
94
|
this.webm = false;
|
|
95
|
+
/**
|
|
96
|
+
* @type {boolean}
|
|
97
|
+
*/
|
|
29
98
|
this.dolby = false;
|
|
99
|
+
/**
|
|
100
|
+
* @type {boolean}
|
|
101
|
+
*/
|
|
30
102
|
this.avif = false;
|
|
103
|
+
/**
|
|
104
|
+
* @type {boolean}
|
|
105
|
+
*/
|
|
31
106
|
this.webp = false;
|
|
107
|
+
/**
|
|
108
|
+
* @type {boolean}
|
|
109
|
+
*/
|
|
32
110
|
this.fullscreen = false;
|
|
111
|
+
/**
|
|
112
|
+
* @type {string}
|
|
113
|
+
*/
|
|
33
114
|
this.requestFullscreen = '';
|
|
115
|
+
/**
|
|
116
|
+
* @type {string}
|
|
117
|
+
*/
|
|
34
118
|
this.cancelFullscreen = '';
|
|
119
|
+
/**
|
|
120
|
+
* @type {boolean}
|
|
121
|
+
*/
|
|
35
122
|
this.fullscreenKeyboard = false;
|
|
36
123
|
}
|
|
37
124
|
}
|
package/src/phaser/core/dom.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Point } from '../geom/point';
|
|
2
|
+
import { Device } from './device';
|
|
2
3
|
|
|
3
4
|
class VisualBoundsDesktopRectangle {
|
|
4
5
|
/**
|
|
@@ -182,7 +183,7 @@ class DocumentBoundsRectangle {
|
|
|
182
183
|
export class DOM {
|
|
183
184
|
/**
|
|
184
185
|
* TBD.
|
|
185
|
-
* @param device
|
|
186
|
+
* @param {Device} device - TBD.
|
|
186
187
|
*/
|
|
187
188
|
constructor(device) {
|
|
188
189
|
this.treatAsDesktop =
|
|
@@ -200,8 +201,9 @@ export class DOM {
|
|
|
200
201
|
|
|
201
202
|
/**
|
|
202
203
|
* TBD.
|
|
203
|
-
* @param element
|
|
204
|
-
* @param point
|
|
204
|
+
* @param element - TBD.
|
|
205
|
+
* @param {Point} point - TBD.
|
|
206
|
+
* @returns {Point} TBD.
|
|
205
207
|
*/
|
|
206
208
|
getOffset(element, point = null) {
|
|
207
209
|
point = point || new Point();
|
|
@@ -217,8 +219,9 @@ export class DOM {
|
|
|
217
219
|
|
|
218
220
|
/**
|
|
219
221
|
* TBD.
|
|
220
|
-
* @param element
|
|
221
|
-
* @param cushion
|
|
222
|
+
* @param element - TBD.
|
|
223
|
+
* @param {number} cushion - TBD.
|
|
224
|
+
* @returns {boolean} TBD.
|
|
222
225
|
*/
|
|
223
226
|
getBounds(element, cushion = 0) {
|
|
224
227
|
element = element && !element.nodeType ? element[0] : element;
|
|
@@ -230,8 +233,9 @@ export class DOM {
|
|
|
230
233
|
|
|
231
234
|
/**
|
|
232
235
|
* TBD.
|
|
233
|
-
* @param coords
|
|
234
|
-
* @param cushion
|
|
236
|
+
* @param coords - TBD.
|
|
237
|
+
* @param {number} cushion - TBD.
|
|
238
|
+
* @returns {object} TBD.
|
|
235
239
|
*/
|
|
236
240
|
calibrate(coords, cushion = 0) {
|
|
237
241
|
const output = {
|
|
@@ -249,7 +253,8 @@ export class DOM {
|
|
|
249
253
|
|
|
250
254
|
/**
|
|
251
255
|
* TBD.
|
|
252
|
-
* @param primaryFallback
|
|
256
|
+
* @param {string} primaryFallback - TBD.
|
|
257
|
+
* @returns {string} TBD.
|
|
253
258
|
*/
|
|
254
259
|
getScreenOrientation(primaryFallback) {
|
|
255
260
|
const screen = window.screen;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Signal } from './signal';
|
|
2
|
+
import { DisplayObject } from '../display/display_object';
|
|
2
3
|
|
|
3
4
|
export class EventManager {
|
|
4
5
|
/**
|
|
5
6
|
* TBD.
|
|
6
|
-
* @param sprite - TBD.
|
|
7
|
+
* @param {DisplayObject} sprite - TBD.
|
|
7
8
|
*/
|
|
8
9
|
constructor(sprite) {
|
|
9
10
|
this.parent = sprite;
|
|
@@ -20,7 +20,7 @@ export class GameObjectFactory {
|
|
|
20
20
|
* @param {number} x - TBD.
|
|
21
21
|
* @param {number} y - TBD.
|
|
22
22
|
* @param {string} key - TBD.
|
|
23
|
-
* @param frame - TBD.
|
|
23
|
+
* @param {string} frame - TBD.
|
|
24
24
|
* @param {Group} group - TBD.
|
|
25
25
|
* @returns {Image} TBD.
|
|
26
26
|
*/
|
|
@@ -46,8 +46,8 @@ export class GameObjectFactory {
|
|
|
46
46
|
* TBD.
|
|
47
47
|
* @param {number} x - TBD.
|
|
48
48
|
* @param {number} y - TBD.
|
|
49
|
-
* @param text - TBD.
|
|
50
|
-
* @param style - TBD.
|
|
49
|
+
* @param {string} text - TBD.
|
|
50
|
+
* @param {object} style - TBD.
|
|
51
51
|
* @param {Group} group - TBD.
|
|
52
52
|
* @returns {Text} TBD.
|
|
53
53
|
*/
|
|
@@ -63,10 +63,10 @@ export class GameObjectFactory {
|
|
|
63
63
|
* @param {string} key - TBD.
|
|
64
64
|
* @param {Function} callback - TBD.
|
|
65
65
|
* @param {object} callbackContext - TBD.
|
|
66
|
-
* @param overFrame - TBD.
|
|
67
|
-
* @param outFrame - TBD.
|
|
68
|
-
* @param downFrame - TBD.
|
|
69
|
-
* @param upFrame - TBD.
|
|
66
|
+
* @param {string} overFrame - TBD.
|
|
67
|
+
* @param {string} outFrame - TBD.
|
|
68
|
+
* @param {string} downFrame - TBD.
|
|
69
|
+
* @param {string} upFrame - TBD.
|
|
70
70
|
* @param {Group} group - TBD.
|
|
71
71
|
* @returns {Button} TBD.
|
|
72
72
|
*/
|
|
@@ -93,11 +93,11 @@ export class GameObjectFactory {
|
|
|
93
93
|
* TBD.
|
|
94
94
|
* @param {number} x - TBD.
|
|
95
95
|
* @param {number} y - TBD.
|
|
96
|
-
* @param font - TBD.
|
|
97
|
-
* @param text - TBD.
|
|
98
|
-
* @param size - TBD.
|
|
96
|
+
* @param {string} font - TBD.
|
|
97
|
+
* @param {string} text - TBD.
|
|
98
|
+
* @param {number} size - TBD.
|
|
99
99
|
* @param {Group} group - TBD.
|
|
100
|
-
* @param align - TBD.
|
|
100
|
+
* @param {string} align - TBD.
|
|
101
101
|
* @returns {BitmapText} TBD.
|
|
102
102
|
*/
|
|
103
103
|
bitmapText(x, y, font, text, size, group = null, align = 'left') {
|
package/src/phaser/core/game.js
CHANGED
|
@@ -83,7 +83,7 @@ export class MSPointer {
|
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* TBD.
|
|
86
|
-
* @param {
|
|
86
|
+
* @param {PointerEvent} event - TBD.
|
|
87
87
|
*/
|
|
88
88
|
onPointerDown(event) {
|
|
89
89
|
this.event = event;
|
|
@@ -104,7 +104,7 @@ export class MSPointer {
|
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* TBD.
|
|
107
|
-
* @param {
|
|
107
|
+
* @param {PointerEvent} event - TBD.
|
|
108
108
|
*/
|
|
109
109
|
onPointerMove(event) {
|
|
110
110
|
this.event = event;
|
|
@@ -125,7 +125,7 @@ export class MSPointer {
|
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
127
|
* TBD.
|
|
128
|
-
* @param {
|
|
128
|
+
* @param {PointerEvent} event - TBD.
|
|
129
129
|
*/
|
|
130
130
|
onPointerUp(event) {
|
|
131
131
|
this.event = event;
|
|
@@ -146,7 +146,7 @@ export class MSPointer {
|
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* TBD.
|
|
149
|
-
* @param {
|
|
149
|
+
* @param {PointerEvent} event - TBD.
|
|
150
150
|
*/
|
|
151
151
|
onPointerUpGlobal(event) {
|
|
152
152
|
if ((event.pointerType === 'mouse' || event.pointerType === 0x00000004) && !this.input.mousePointer.withinGame) {
|
|
@@ -161,7 +161,7 @@ export class MSPointer {
|
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
163
|
* TBD.
|
|
164
|
-
* @param {
|
|
164
|
+
* @param {PointerEvent} event - TBD.
|
|
165
165
|
*/
|
|
166
166
|
onPointerOut(event) {
|
|
167
167
|
this.event = event;
|
|
@@ -193,7 +193,7 @@ export class MSPointer {
|
|
|
193
193
|
|
|
194
194
|
/**
|
|
195
195
|
* TBD.
|
|
196
|
-
* @param {
|
|
196
|
+
* @param {PointerEvent} event - TBD.
|
|
197
197
|
*/
|
|
198
198
|
onPointerOver(event) {
|
|
199
199
|
this.event = event;
|
|
@@ -422,7 +422,7 @@ export class Pointer {
|
|
|
422
422
|
* @param {string} name - TBD.
|
|
423
423
|
* @param {Function} callback - TBD.
|
|
424
424
|
* @param {object} callbackContext - TBD.
|
|
425
|
-
* @param callbackArgs - TBD.
|
|
425
|
+
* @param {...any} callbackArgs - TBD.
|
|
426
426
|
*/
|
|
427
427
|
addClickTrampoline(name, callback, callbackContext, callbackArgs) {
|
|
428
428
|
if (!this.isDown) {
|