@vpmedia/phaser 1.103.0 → 1.104.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/dist/index.js +1035 -18
- package/dist/index.js.map +1 -1
- package/dist/phaser/core/animation.d.ts +47 -1
- package/dist/phaser/core/animation.d.ts.map +1 -1
- package/dist/phaser/core/animation_manager.d.ts +9 -0
- package/dist/phaser/core/animation_manager.d.ts.map +1 -1
- package/dist/phaser/core/cache.d.ts +8 -0
- package/dist/phaser/core/cache.d.ts.map +1 -1
- package/dist/phaser/core/device.d.ts +23 -0
- package/dist/phaser/core/device.d.ts.map +1 -1
- package/dist/phaser/core/event_manager.d.ts +16 -0
- package/dist/phaser/core/event_manager.d.ts.map +1 -1
- package/dist/phaser/core/factory.d.ts +1 -0
- package/dist/phaser/core/factory.d.ts.map +1 -1
- package/dist/phaser/core/frame_data.d.ts +2 -0
- package/dist/phaser/core/frame_data.d.ts.map +1 -1
- package/dist/phaser/core/game.d.ts +56 -0
- package/dist/phaser/core/game.d.ts.map +1 -1
- package/dist/phaser/core/input.d.ts +51 -0
- package/dist/phaser/core/input.d.ts.map +1 -1
- package/dist/phaser/core/input_handler.d.ts +41 -0
- package/dist/phaser/core/input_handler.d.ts.map +1 -1
- package/dist/phaser/core/input_mouse.d.ts.map +1 -1
- package/dist/phaser/core/input_mspointer.d.ts +16 -0
- package/dist/phaser/core/input_mspointer.d.ts.map +1 -1
- package/dist/phaser/core/input_pointer.d.ts +44 -0
- package/dist/phaser/core/input_pointer.d.ts.map +1 -1
- package/dist/phaser/core/input_touch.d.ts +17 -0
- package/dist/phaser/core/input_touch.d.ts.map +1 -1
- package/dist/phaser/core/loader.d.ts +28 -0
- package/dist/phaser/core/loader.d.ts.map +1 -1
- package/dist/phaser/core/scale_manager.d.ts +55 -0
- package/dist/phaser/core/scale_manager.d.ts.map +1 -1
- package/dist/phaser/core/scene.d.ts +2 -0
- package/dist/phaser/core/scene.d.ts.map +1 -1
- package/dist/phaser/core/scene_manager.d.ts +15 -0
- package/dist/phaser/core/scene_manager.d.ts.map +1 -1
- package/dist/phaser/core/sound.d.ts +93 -0
- package/dist/phaser/core/sound.d.ts.map +1 -1
- package/dist/phaser/core/sound_manager.d.ts +17 -0
- package/dist/phaser/core/sound_manager.d.ts.map +1 -1
- package/dist/phaser/core/sound_sprite.d.ts +6 -0
- package/dist/phaser/core/sound_sprite.d.ts.map +1 -1
- package/dist/phaser/core/stage.d.ts +4 -0
- package/dist/phaser/core/stage.d.ts.map +1 -1
- package/dist/phaser/core/time.d.ts +27 -0
- package/dist/phaser/core/time.d.ts.map +1 -1
- package/dist/phaser/core/timer.d.ts +20 -0
- package/dist/phaser/core/timer.d.ts.map +1 -1
- package/dist/phaser/core/timer_event.d.ts +9 -0
- package/dist/phaser/core/timer_event.d.ts.map +1 -1
- package/dist/phaser/core/tween.d.ts +46 -0
- package/dist/phaser/core/tween.d.ts.map +1 -1
- package/dist/phaser/core/tween_data.d.ts +24 -0
- package/dist/phaser/core/tween_data.d.ts.map +1 -1
- package/dist/phaser/core/tween_manager.d.ts +4 -0
- package/dist/phaser/core/tween_manager.d.ts.map +1 -1
- package/dist/phaser/display/bitmap_text.d.ts +13 -0
- package/dist/phaser/display/bitmap_text.d.ts.map +1 -1
- package/dist/phaser/display/button.d.ts +28 -0
- package/dist/phaser/display/button.d.ts.map +1 -1
- package/dist/phaser/display/canvas/buffer.d.ts +4 -0
- package/dist/phaser/display/canvas/buffer.d.ts.map +1 -1
- package/dist/phaser/display/canvas/renderer.d.ts +13 -0
- package/dist/phaser/display/canvas/renderer.d.ts.map +1 -1
- package/dist/phaser/display/display_object.d.ts +57 -1
- package/dist/phaser/display/display_object.d.ts.map +1 -1
- package/dist/phaser/display/graphics.d.ts +18 -0
- package/dist/phaser/display/graphics.d.ts.map +1 -1
- package/dist/phaser/display/graphics_data.d.ts +10 -0
- package/dist/phaser/display/graphics_data.d.ts.map +1 -1
- package/dist/phaser/display/group.d.ts +28 -0
- package/dist/phaser/display/group.d.ts.map +1 -1
- package/dist/phaser/display/image.d.ts +39 -1
- package/dist/phaser/display/image.d.ts.map +1 -1
- package/dist/phaser/display/webgl/abstract_filter.d.ts +6 -0
- package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
- package/dist/phaser/display/webgl/base_texture.d.ts +12 -0
- package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/blend_manager.d.ts +2 -0
- package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts +15 -0
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_manager.d.ts +3 -0
- package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_texture.d.ts +4 -0
- package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/graphics_data.d.ts +9 -0
- package/dist/phaser/display/webgl/graphics_data.d.ts.map +1 -1
- package/dist/phaser/display/webgl/render_texture.d.ts +10 -0
- package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/renderer.d.ts +17 -0
- package/dist/phaser/display/webgl/renderer.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/complex.d.ts +5 -0
- package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/fast.d.ts +6 -0
- package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/normal.d.ts +10 -0
- package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/primitive.d.ts +5 -0
- package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/strip.d.ts +5 -0
- package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader_manager.d.ts +10 -0
- package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/sprite_batch.d.ts +16 -0
- package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/stencil_manager.d.ts +3 -0
- package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/texture.d.ts +20 -0
- package/dist/phaser/display/webgl/texture.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/phaser/core/animation.ts +50 -4
- package/src/phaser/core/animation_manager.ts +9 -0
- package/src/phaser/core/cache.ts +8 -0
- package/src/phaser/core/device.ts +23 -0
- package/src/phaser/core/event_manager.ts +16 -0
- package/src/phaser/core/factory.ts +1 -0
- package/src/phaser/core/frame_data.ts +2 -0
- package/src/phaser/core/game.ts +60 -4
- package/src/phaser/core/input.ts +51 -0
- package/src/phaser/core/input_handler.ts +41 -0
- package/src/phaser/core/input_mouse.ts +23 -0
- package/src/phaser/core/input_mspointer.ts +16 -0
- package/src/phaser/core/input_pointer.ts +44 -0
- package/src/phaser/core/input_touch.ts +17 -0
- package/src/phaser/core/loader.ts +28 -0
- package/src/phaser/core/scale_manager.ts +55 -0
- package/src/phaser/core/scene.ts +2 -0
- package/src/phaser/core/scene_manager.ts +15 -0
- package/src/phaser/core/sound.ts +100 -7
- package/src/phaser/core/sound_manager.ts +17 -0
- package/src/phaser/core/sound_sprite.ts +6 -0
- package/src/phaser/core/stage.ts +4 -0
- package/src/phaser/core/time.ts +27 -0
- package/src/phaser/core/timer.ts +20 -0
- package/src/phaser/core/timer_event.ts +9 -0
- package/src/phaser/core/tween.ts +49 -3
- package/src/phaser/core/tween_data.ts +24 -0
- package/src/phaser/core/tween_manager.ts +4 -0
- package/src/phaser/display/bitmap_text.ts +13 -0
- package/src/phaser/display/button.ts +28 -0
- package/src/phaser/display/canvas/buffer.ts +4 -0
- package/src/phaser/display/canvas/renderer.ts +13 -0
- package/src/phaser/display/display_object.ts +91 -31
- package/src/phaser/display/graphics.ts +18 -0
- package/src/phaser/display/graphics_data.ts +10 -0
- package/src/phaser/display/group.ts +28 -0
- package/src/phaser/display/image.ts +44 -6
- package/src/phaser/display/webgl/abstract_filter.ts +6 -0
- package/src/phaser/display/webgl/base_texture.ts +12 -0
- package/src/phaser/display/webgl/blend_manager.ts +2 -0
- package/src/phaser/display/webgl/fast_sprite_batch.ts +15 -0
- package/src/phaser/display/webgl/filter_manager.ts +3 -0
- package/src/phaser/display/webgl/filter_texture.ts +4 -0
- package/src/phaser/display/webgl/graphics_data.ts +9 -0
- package/src/phaser/display/webgl/render_texture.ts +10 -0
- package/src/phaser/display/webgl/renderer.ts +17 -0
- package/src/phaser/display/webgl/shader/complex.ts +5 -0
- package/src/phaser/display/webgl/shader/fast.ts +6 -0
- package/src/phaser/display/webgl/shader/normal.ts +10 -0
- package/src/phaser/display/webgl/shader/primitive.ts +5 -0
- package/src/phaser/display/webgl/shader/strip.ts +5 -0
- package/src/phaser/display/webgl/shader_manager.ts +10 -0
- package/src/phaser/display/webgl/sprite_batch.ts +16 -0
- package/src/phaser/display/webgl/stencil_manager.ts +3 -0
- package/src/phaser/display/webgl/texture.ts +20 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpmedia/phaser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.104.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",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@vpmedia/simplify": "^1.
|
|
37
|
+
"@vpmedia/simplify": "^1.76.0",
|
|
38
38
|
"uuid": "^14.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -2,6 +2,52 @@
|
|
|
2
2
|
import { Signal } from './signal.js';
|
|
3
3
|
|
|
4
4
|
export class Animation {
|
|
5
|
+
/** @type {import('./game.js').Game} */
|
|
6
|
+
game;
|
|
7
|
+
/** @type {import('../display/image.js').Image} */
|
|
8
|
+
_parent;
|
|
9
|
+
/** @type {import('./frame_data.js').FrameData} */
|
|
10
|
+
_frameData;
|
|
11
|
+
/** @type {string} */
|
|
12
|
+
name;
|
|
13
|
+
/** @type {Array<string|number>} */
|
|
14
|
+
_frames;
|
|
15
|
+
/** @type {number} */
|
|
16
|
+
delay;
|
|
17
|
+
/** @type {boolean} */
|
|
18
|
+
loop;
|
|
19
|
+
/** @type {number} */
|
|
20
|
+
loopCount;
|
|
21
|
+
/** @type {boolean} */
|
|
22
|
+
isFinished;
|
|
23
|
+
/** @type {boolean} */
|
|
24
|
+
isPlaying;
|
|
25
|
+
/** @type {boolean} */
|
|
26
|
+
isPaused;
|
|
27
|
+
/** @type {number} */
|
|
28
|
+
_pauseStartTime;
|
|
29
|
+
/** @type {number} */
|
|
30
|
+
_frameIndex;
|
|
31
|
+
/** @type {number} */
|
|
32
|
+
_frameDiff;
|
|
33
|
+
/** @type {number} */
|
|
34
|
+
_frameSkip;
|
|
35
|
+
/** @type {import('./frame.js').Frame} */
|
|
36
|
+
currentFrame;
|
|
37
|
+
/** @type {Signal} */
|
|
38
|
+
onStart;
|
|
39
|
+
/** @type {Signal | null} */
|
|
40
|
+
onUpdate;
|
|
41
|
+
/** @type {Signal} */
|
|
42
|
+
onComplete;
|
|
43
|
+
/** @type {Signal} */
|
|
44
|
+
onLoop;
|
|
45
|
+
/** @type {boolean} */
|
|
46
|
+
isReversed;
|
|
47
|
+
/** @type {number} */
|
|
48
|
+
_timeLastFrame;
|
|
49
|
+
/** @type {number} */
|
|
50
|
+
_timeNextFrame;
|
|
5
51
|
/**
|
|
6
52
|
* Creates a new Animation instance.
|
|
7
53
|
* @param {import('./game.js').Game} game - The game instance this animation belongs to.
|
|
@@ -121,7 +167,7 @@ export class Animation {
|
|
|
121
167
|
*/
|
|
122
168
|
reverseOnce() {
|
|
123
169
|
this.onComplete.addOnce(this.reverse, this);
|
|
124
|
-
return this.
|
|
170
|
+
return this.toReversed();
|
|
125
171
|
}
|
|
126
172
|
|
|
127
173
|
/**
|
|
@@ -243,7 +289,7 @@ export class Animation {
|
|
|
243
289
|
if (this.onUpdate) {
|
|
244
290
|
this.onUpdate.dispatch(this, this.currentFrame);
|
|
245
291
|
// False if the animation was destroyed from within a callback
|
|
246
|
-
return
|
|
292
|
+
return Boolean(this._frameData);
|
|
247
293
|
}
|
|
248
294
|
return true;
|
|
249
295
|
}
|
|
@@ -276,7 +322,7 @@ export class Animation {
|
|
|
276
322
|
if (this.onUpdate && signalUpdate) {
|
|
277
323
|
this.onUpdate.dispatch(this, this.currentFrame);
|
|
278
324
|
// False if the animation was destroyed from within a callback
|
|
279
|
-
return
|
|
325
|
+
return Boolean(this._frameData);
|
|
280
326
|
}
|
|
281
327
|
return true;
|
|
282
328
|
}
|
|
@@ -476,4 +522,4 @@ export class Animation {
|
|
|
476
522
|
this.onUpdate = null;
|
|
477
523
|
}
|
|
478
524
|
}
|
|
479
|
-
}
|
|
525
|
+
}
|
|
@@ -3,6 +3,15 @@ import { Animation } from './animation.js';
|
|
|
3
3
|
import { ENGINE_ERROR_CANNOT_SET_FRAME, ENGINE_ERROR_CANNOT_SET_FRAME_NAME } from './error_code.js';
|
|
4
4
|
|
|
5
5
|
export class AnimationManager {
|
|
6
|
+
sprite;
|
|
7
|
+
game;
|
|
8
|
+
currentFrame;
|
|
9
|
+
currentAnim;
|
|
10
|
+
updateIfVisible;
|
|
11
|
+
isLoaded;
|
|
12
|
+
_frameData;
|
|
13
|
+
_anims;
|
|
14
|
+
_outputFrames;
|
|
6
15
|
/**
|
|
7
16
|
* Creates a new AnimationManager instance.
|
|
8
17
|
* @param {import('../display/image.js').Image} sprite - Reference to the parent Sprite.
|
package/src/phaser/core/cache.ts
CHANGED
|
@@ -19,6 +19,14 @@ export const XML = 8;
|
|
|
19
19
|
export const RENDER_TEXTURE = 9;
|
|
20
20
|
|
|
21
21
|
export class Cache {
|
|
22
|
+
game;
|
|
23
|
+
autoResolveURL;
|
|
24
|
+
_cache;
|
|
25
|
+
_urlMap;
|
|
26
|
+
_urlResolver;
|
|
27
|
+
_urlTemp;
|
|
28
|
+
onSoundUnlock;
|
|
29
|
+
_cacheMap;
|
|
22
30
|
/**
|
|
23
31
|
* Creates a new Cache instance.
|
|
24
32
|
* @param {import('./game.js').Game} game - The game instance.
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
export class Device {
|
|
3
|
+
desktop;
|
|
4
|
+
iOS;
|
|
5
|
+
android;
|
|
6
|
+
chromeOS;
|
|
7
|
+
linux;
|
|
8
|
+
macOS;
|
|
9
|
+
windows;
|
|
10
|
+
windowsPhone;
|
|
11
|
+
canvas;
|
|
12
|
+
touch;
|
|
13
|
+
mspointer;
|
|
14
|
+
wheelEvent;
|
|
15
|
+
chrome;
|
|
16
|
+
firefox;
|
|
17
|
+
edge;
|
|
18
|
+
safari;
|
|
19
|
+
fullscreen;
|
|
20
|
+
requestFullscreen;
|
|
21
|
+
cancelFullscreen;
|
|
22
|
+
fullscreenKeyboard;
|
|
23
|
+
noAudioFormat;
|
|
24
|
+
supportedAudioFormats;
|
|
25
|
+
supportedImageFormats;
|
|
3
26
|
/**
|
|
4
27
|
* Creates a new Device instance.
|
|
5
28
|
* This class provides information about the current device and browser capabilities.
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
import { Signal } from './signal.js';
|
|
3
3
|
|
|
4
4
|
export class EventManager {
|
|
5
|
+
parent;
|
|
6
|
+
_onAddedToGroup;
|
|
7
|
+
_onRemovedFromGroup;
|
|
8
|
+
_onDestroy;
|
|
9
|
+
_onOutOfBounds;
|
|
10
|
+
_onEnterBounds;
|
|
11
|
+
_onInputOver;
|
|
12
|
+
_onInputOut;
|
|
13
|
+
_onInputDown;
|
|
14
|
+
_onInputUp;
|
|
15
|
+
_onDragStart;
|
|
16
|
+
_onDragUpdate;
|
|
17
|
+
_onDragStop;
|
|
18
|
+
_onAnimationStart;
|
|
19
|
+
_onAnimationComplete;
|
|
20
|
+
_onAnimationLoop;
|
|
5
21
|
/**
|
|
6
22
|
* Creates a new EventManager instance.
|
|
7
23
|
* @param {import('../display/display_object.js').DisplayObject} sprite - Reference to the parent DisplayObject.
|
|
@@ -7,6 +7,7 @@ import { Image } from '../display/image.js';
|
|
|
7
7
|
import { Text } from '../display/text.js';
|
|
8
8
|
|
|
9
9
|
export class GameObjectFactory {
|
|
10
|
+
game;
|
|
10
11
|
/**
|
|
11
12
|
* Creates a new GameObjectFactory instance.
|
|
12
13
|
* @param {import('./game.js').Game} game - The game instance this factory belongs to.
|
package/src/phaser/core/game.ts
CHANGED
|
@@ -21,6 +21,62 @@ import { TweenManager } from './tween_manager.js';
|
|
|
21
21
|
import { World } from './world.js';
|
|
22
22
|
|
|
23
23
|
export class Game {
|
|
24
|
+
/** @type {object} */
|
|
25
|
+
config;
|
|
26
|
+
/** @type {number} */
|
|
27
|
+
id;
|
|
28
|
+
/** @type {string|HTMLElement} */
|
|
29
|
+
parent;
|
|
30
|
+
/** @type {number} */
|
|
31
|
+
width;
|
|
32
|
+
/** @type {number} */
|
|
33
|
+
height;
|
|
34
|
+
/** @type {CanvasRenderer | WebGLRenderer} */
|
|
35
|
+
renderer;
|
|
36
|
+
/** @type {SceneManager} */
|
|
37
|
+
state;
|
|
38
|
+
/** @type {boolean} */
|
|
39
|
+
isBooted;
|
|
40
|
+
/** @type {boolean} */
|
|
41
|
+
paused;
|
|
42
|
+
/** @type {RequestAnimationFrame} */
|
|
43
|
+
raf;
|
|
44
|
+
/** @type {GameObjectFactory} */
|
|
45
|
+
add;
|
|
46
|
+
/** @type {Cache} */
|
|
47
|
+
cache;
|
|
48
|
+
/** @type {Input} */
|
|
49
|
+
input;
|
|
50
|
+
/** @type {Loader} */
|
|
51
|
+
load;
|
|
52
|
+
/** @type {ScaleManager} */
|
|
53
|
+
scale;
|
|
54
|
+
/** @type {SoundManager} */
|
|
55
|
+
sound;
|
|
56
|
+
/** @type {Stage} */
|
|
57
|
+
stage;
|
|
58
|
+
/** @type {Time} */
|
|
59
|
+
time;
|
|
60
|
+
/** @type {TweenManager} */
|
|
61
|
+
tweens;
|
|
62
|
+
/** @type {World} */
|
|
63
|
+
world;
|
|
64
|
+
/** @type {Device} */
|
|
65
|
+
device;
|
|
66
|
+
/** @type {Logger} */
|
|
67
|
+
logger;
|
|
68
|
+
/** @type {HTMLCanvasElement} */
|
|
69
|
+
canvas;
|
|
70
|
+
/** @type {CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext} */
|
|
71
|
+
context;
|
|
72
|
+
/** @type {Signal} */
|
|
73
|
+
onPause;
|
|
74
|
+
/** @type {Signal} */
|
|
75
|
+
onResume;
|
|
76
|
+
/** @type {Signal} */
|
|
77
|
+
onBoot;
|
|
78
|
+
/** @type {boolean} */
|
|
79
|
+
isPaused;
|
|
24
80
|
/**
|
|
25
81
|
* Creates a new Game instance.
|
|
26
82
|
* @param {object} gameConfig - The configuration object for the game.
|
|
@@ -223,9 +279,9 @@ export class Game {
|
|
|
223
279
|
this.logger.info('parseConfig');
|
|
224
280
|
this.parseConfigElement(config, 'width', 800);
|
|
225
281
|
this.parseConfigElement(config, 'height', 600);
|
|
226
|
-
this.parseConfigElement(config, 'backgroundColor',
|
|
282
|
+
this.parseConfigElement(config, 'backgroundColor', 0x00_00_00);
|
|
227
283
|
this.parseConfigElement(config, 'canvasID', '');
|
|
228
|
-
this.parseConfigElement(config, 'canvasStyle'
|
|
284
|
+
this.parseConfigElement(config, 'canvasStyle');
|
|
229
285
|
this.parseConfigElement(config, 'resolution', 1);
|
|
230
286
|
this.parseConfigElement(config, 'transparent', false);
|
|
231
287
|
this.parseConfigElement(config, 'antialias', false);
|
|
@@ -240,7 +296,7 @@ export class Game {
|
|
|
240
296
|
}
|
|
241
297
|
let state = null;
|
|
242
298
|
if (config.state) {
|
|
243
|
-
state = config
|
|
299
|
+
({ state } = config);
|
|
244
300
|
}
|
|
245
301
|
this.state = new SceneManager(this, state);
|
|
246
302
|
}
|
|
@@ -265,7 +321,7 @@ export class Game {
|
|
|
265
321
|
this.logger.info('contextRestored', event);
|
|
266
322
|
if (this.renderer) {
|
|
267
323
|
this.renderer.initContext(this);
|
|
268
|
-
//
|
|
324
|
+
// This.cache.clearGLTextures();
|
|
269
325
|
this.renderer.contextLost = false;
|
|
270
326
|
}
|
|
271
327
|
}
|
package/src/phaser/core/input.ts
CHANGED
|
@@ -15,6 +15,57 @@ import { Signal } from './signal.js';
|
|
|
15
15
|
const MAX_POINTERS = 10;
|
|
16
16
|
|
|
17
17
|
export class Input {
|
|
18
|
+
game;
|
|
19
|
+
hitCanvas;
|
|
20
|
+
hitContext;
|
|
21
|
+
moveCallbacks;
|
|
22
|
+
lockCallbacks;
|
|
23
|
+
customCandidateHandler;
|
|
24
|
+
customCandidateHandlerContext;
|
|
25
|
+
pollRate;
|
|
26
|
+
enabled;
|
|
27
|
+
multiInputOverride;
|
|
28
|
+
position;
|
|
29
|
+
speed;
|
|
30
|
+
circle;
|
|
31
|
+
scale;
|
|
32
|
+
maxPointers;
|
|
33
|
+
tapRate;
|
|
34
|
+
doubleTapRate;
|
|
35
|
+
holdRate;
|
|
36
|
+
justPressedRate;
|
|
37
|
+
justReleasedRate;
|
|
38
|
+
recordPointerHistory;
|
|
39
|
+
recordRate;
|
|
40
|
+
recordLimit;
|
|
41
|
+
pointer1;
|
|
42
|
+
pointer2;
|
|
43
|
+
pointer3;
|
|
44
|
+
pointer4;
|
|
45
|
+
pointer5;
|
|
46
|
+
pointer6;
|
|
47
|
+
pointer7;
|
|
48
|
+
pointer8;
|
|
49
|
+
pointer9;
|
|
50
|
+
pointer10;
|
|
51
|
+
pointers;
|
|
52
|
+
activePointer;
|
|
53
|
+
mousePointer;
|
|
54
|
+
mouse;
|
|
55
|
+
touch;
|
|
56
|
+
mspointer;
|
|
57
|
+
resetLocked;
|
|
58
|
+
onDown;
|
|
59
|
+
onUp;
|
|
60
|
+
onTap;
|
|
61
|
+
onHold;
|
|
62
|
+
minPriorityID;
|
|
63
|
+
interactiveItems;
|
|
64
|
+
_localPoint;
|
|
65
|
+
_pollCounter;
|
|
66
|
+
_oldPosition;
|
|
67
|
+
_x;
|
|
68
|
+
_y;
|
|
18
69
|
/**
|
|
19
70
|
* TBD.
|
|
20
71
|
* @param {import('./game.js').Game} game - TBD.
|
|
@@ -4,6 +4,47 @@ import { distance } from '../util/math.js';
|
|
|
4
4
|
import { GROUP } from './const.js';
|
|
5
5
|
|
|
6
6
|
export class InputHandler {
|
|
7
|
+
sprite;
|
|
8
|
+
game;
|
|
9
|
+
enabled;
|
|
10
|
+
checked;
|
|
11
|
+
priorityID;
|
|
12
|
+
useHandCursor;
|
|
13
|
+
_setHandCursor;
|
|
14
|
+
isDragged;
|
|
15
|
+
allowHorizontalDrag;
|
|
16
|
+
allowVerticalDrag;
|
|
17
|
+
bringToTop;
|
|
18
|
+
snapOffset;
|
|
19
|
+
snapOnDrag;
|
|
20
|
+
snapOnRelease;
|
|
21
|
+
snapX;
|
|
22
|
+
snapY;
|
|
23
|
+
snapOffsetX;
|
|
24
|
+
snapOffsetY;
|
|
25
|
+
pixelPerfectOver;
|
|
26
|
+
pixelPerfectClick;
|
|
27
|
+
pixelPerfectAlpha;
|
|
28
|
+
draggable;
|
|
29
|
+
boundsRect;
|
|
30
|
+
boundsSprite;
|
|
31
|
+
scaleLayer;
|
|
32
|
+
dragOffset;
|
|
33
|
+
dragFromCenter;
|
|
34
|
+
dragStopBlocksInputUp;
|
|
35
|
+
dragStartPoint;
|
|
36
|
+
dragDistanceThreshold;
|
|
37
|
+
dragTimeThreshold;
|
|
38
|
+
downPoint;
|
|
39
|
+
snapPoint;
|
|
40
|
+
_dragPoint;
|
|
41
|
+
_dragPhase;
|
|
42
|
+
_pendingDrag;
|
|
43
|
+
_dragTimePass;
|
|
44
|
+
_dragDistancePass;
|
|
45
|
+
_wasEnabled;
|
|
46
|
+
_tempPoint;
|
|
47
|
+
_pointerData;
|
|
7
48
|
/**
|
|
8
49
|
* TBD.
|
|
9
50
|
* @param {import('../display/image.js').Image} sprite - TBD.
|
|
@@ -9,6 +9,29 @@ const WHEEL_UP = 1;
|
|
|
9
9
|
const WHEEL_DOWN = -1; */
|
|
10
10
|
|
|
11
11
|
class WheelEventProxy {
|
|
12
|
+
game;
|
|
13
|
+
input;
|
|
14
|
+
callbackContext;
|
|
15
|
+
mouseDownCallback;
|
|
16
|
+
mouseUpCallback;
|
|
17
|
+
mouseOutCallback;
|
|
18
|
+
mouseOverCallback;
|
|
19
|
+
mouseWheelCallback;
|
|
20
|
+
mouseMoveCallback;
|
|
21
|
+
capture;
|
|
22
|
+
button;
|
|
23
|
+
wheelDelta;
|
|
24
|
+
enabled;
|
|
25
|
+
locked;
|
|
26
|
+
stopOnGameOut;
|
|
27
|
+
event;
|
|
28
|
+
_onMouseDown;
|
|
29
|
+
_onMouseMove;
|
|
30
|
+
_onMouseUp;
|
|
31
|
+
_onMouseOut;
|
|
32
|
+
_onMouseOver;
|
|
33
|
+
_onMouseWheel;
|
|
34
|
+
_wheelEvent;
|
|
12
35
|
/**
|
|
13
36
|
* TBD.
|
|
14
37
|
* @param {number} scaleFactor - TBD.
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
export class MSPointer {
|
|
3
|
+
game;
|
|
4
|
+
input;
|
|
5
|
+
callbackContext;
|
|
6
|
+
pointerDownCallback;
|
|
7
|
+
pointerMoveCallback;
|
|
8
|
+
pointerUpCallback;
|
|
9
|
+
capture;
|
|
10
|
+
button;
|
|
11
|
+
event;
|
|
12
|
+
enabled;
|
|
13
|
+
_onMSPointerDown;
|
|
14
|
+
_onMSPointerMove;
|
|
15
|
+
_onMSPointerUp;
|
|
16
|
+
_onMSPointerUpGlobal;
|
|
17
|
+
_onMSPointerOut;
|
|
18
|
+
_onMSPointerOver;
|
|
3
19
|
/**
|
|
4
20
|
* TBD.
|
|
5
21
|
* @param {import('./game.js').Game} game - TBD.
|
|
@@ -11,6 +11,50 @@ import {
|
|
|
11
11
|
} from './const.js';
|
|
12
12
|
|
|
13
13
|
export class Pointer {
|
|
14
|
+
game;
|
|
15
|
+
id;
|
|
16
|
+
type;
|
|
17
|
+
exists;
|
|
18
|
+
identifier;
|
|
19
|
+
pointerId;
|
|
20
|
+
pointerMode;
|
|
21
|
+
target;
|
|
22
|
+
button;
|
|
23
|
+
_holdSent;
|
|
24
|
+
_history;
|
|
25
|
+
_nextDrop;
|
|
26
|
+
_stateReset;
|
|
27
|
+
withinGame;
|
|
28
|
+
clientX;
|
|
29
|
+
clientY;
|
|
30
|
+
pageX;
|
|
31
|
+
pageY;
|
|
32
|
+
screenX;
|
|
33
|
+
screenY;
|
|
34
|
+
rawMovementX;
|
|
35
|
+
rawMovementY;
|
|
36
|
+
movementX;
|
|
37
|
+
movementY;
|
|
38
|
+
x;
|
|
39
|
+
y;
|
|
40
|
+
isMouse;
|
|
41
|
+
isDown;
|
|
42
|
+
isUp;
|
|
43
|
+
timeDown;
|
|
44
|
+
timeUp;
|
|
45
|
+
previousTapTime;
|
|
46
|
+
totalTouches;
|
|
47
|
+
msSinceLastClick;
|
|
48
|
+
targetObject;
|
|
49
|
+
interactiveCandidates;
|
|
50
|
+
active;
|
|
51
|
+
dirty;
|
|
52
|
+
position;
|
|
53
|
+
positionDown;
|
|
54
|
+
positionUp;
|
|
55
|
+
circle;
|
|
56
|
+
_clickTrampolines;
|
|
57
|
+
_trampolineTargetObject;
|
|
14
58
|
/**
|
|
15
59
|
* TBD.
|
|
16
60
|
* @param {import('./game.js').Game} game - TBD.
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
export class Touch {
|
|
3
|
+
game;
|
|
4
|
+
enabled;
|
|
5
|
+
callbackContext;
|
|
6
|
+
touchStartCallback;
|
|
7
|
+
touchMoveCallback;
|
|
8
|
+
touchEndCallback;
|
|
9
|
+
touchEnterCallback;
|
|
10
|
+
touchLeaveCallback;
|
|
11
|
+
touchCancelCallback;
|
|
12
|
+
preventDefault;
|
|
13
|
+
event;
|
|
14
|
+
_onTouchStart;
|
|
15
|
+
_onTouchMove;
|
|
16
|
+
_onTouchEnd;
|
|
17
|
+
_onTouchEnter;
|
|
18
|
+
_onTouchLeave;
|
|
19
|
+
_onTouchCancel;
|
|
3
20
|
/**
|
|
4
21
|
* TBD.
|
|
5
22
|
* @param {import('./game.js').Game} game - TBD.
|
|
@@ -7,6 +7,34 @@ import { Signal } from './signal.js';
|
|
|
7
7
|
const TEXTURE_ATLAS_JSON_HASH = 1;
|
|
8
8
|
|
|
9
9
|
export class Loader {
|
|
10
|
+
game;
|
|
11
|
+
cache;
|
|
12
|
+
isLoading;
|
|
13
|
+
isUseLog;
|
|
14
|
+
isUseRetry;
|
|
15
|
+
maxRetry;
|
|
16
|
+
hasLoaded;
|
|
17
|
+
preloadSprite;
|
|
18
|
+
crossOrigin;
|
|
19
|
+
baseURL;
|
|
20
|
+
path;
|
|
21
|
+
headers;
|
|
22
|
+
onLoadStart;
|
|
23
|
+
onLoadComplete;
|
|
24
|
+
onPackComplete;
|
|
25
|
+
onFileStart;
|
|
26
|
+
onFileComplete;
|
|
27
|
+
onFileError;
|
|
28
|
+
maxParallelDownloads;
|
|
29
|
+
_withSyncPointDepth;
|
|
30
|
+
_fileList;
|
|
31
|
+
_flightQueue;
|
|
32
|
+
_processingHead;
|
|
33
|
+
_fileLoadStarted;
|
|
34
|
+
_totalPackCount;
|
|
35
|
+
_totalFileCount;
|
|
36
|
+
_loadedPackCount;
|
|
37
|
+
_loadedFileCount;
|
|
10
38
|
/**
|
|
11
39
|
* Creates a new Loader instance.
|
|
12
40
|
* @param {import('./game.js').Game} game - Reference to the Phaser Game instance.
|
|
@@ -6,6 +6,61 @@ import { DOM } from './dom.js';
|
|
|
6
6
|
import { Signal } from './signal.js';
|
|
7
7
|
|
|
8
8
|
export class ScaleManager {
|
|
9
|
+
game;
|
|
10
|
+
dom;
|
|
11
|
+
width;
|
|
12
|
+
height;
|
|
13
|
+
minWidth;
|
|
14
|
+
maxWidth;
|
|
15
|
+
minHeight;
|
|
16
|
+
maxHeight;
|
|
17
|
+
offset;
|
|
18
|
+
forceLandscape;
|
|
19
|
+
forcePortrait;
|
|
20
|
+
incorrectOrientation;
|
|
21
|
+
_pageAlignHorizontally;
|
|
22
|
+
_pageAlignVertically;
|
|
23
|
+
onOrientationChange;
|
|
24
|
+
enterIncorrectOrientation;
|
|
25
|
+
leaveIncorrectOrientation;
|
|
26
|
+
hasPhaserSetFullScreen;
|
|
27
|
+
fullScreenTarget;
|
|
28
|
+
_createdFullScreenTarget;
|
|
29
|
+
onFullScreenInit;
|
|
30
|
+
onFullScreenChange;
|
|
31
|
+
onFullScreenError;
|
|
32
|
+
screenOrientation;
|
|
33
|
+
scaleFactor;
|
|
34
|
+
scaleFactorInversed;
|
|
35
|
+
margin;
|
|
36
|
+
bounds;
|
|
37
|
+
aspectRatio;
|
|
38
|
+
sourceAspectRatio;
|
|
39
|
+
event;
|
|
40
|
+
windowConstraints;
|
|
41
|
+
compatibility;
|
|
42
|
+
_scaleMode;
|
|
43
|
+
_fullScreenScaleMode;
|
|
44
|
+
parentIsWindow;
|
|
45
|
+
parentNode;
|
|
46
|
+
parentScaleFactor;
|
|
47
|
+
trackParentInterval;
|
|
48
|
+
onSizeChange;
|
|
49
|
+
onResize;
|
|
50
|
+
onResizeContext;
|
|
51
|
+
_pendingScaleMode;
|
|
52
|
+
_fullScreenRestore;
|
|
53
|
+
_gameSize;
|
|
54
|
+
_userScaleFactor;
|
|
55
|
+
_userScaleTrim;
|
|
56
|
+
_lastUpdate;
|
|
57
|
+
_updateThrottle;
|
|
58
|
+
_updateThrottleReset;
|
|
59
|
+
_parentBounds;
|
|
60
|
+
_tempBounds;
|
|
61
|
+
_lastReportedCanvasSize;
|
|
62
|
+
_lastReportedGameSize;
|
|
63
|
+
_booted;
|
|
9
64
|
/**
|
|
10
65
|
* TBD.
|
|
11
66
|
* @param {import('./game.js').Game} game - TBD.
|
package/src/phaser/core/scene.ts
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
import { Scene } from './scene.js';
|
|
3
3
|
|
|
4
4
|
export class SceneManager {
|
|
5
|
+
game;
|
|
6
|
+
states;
|
|
7
|
+
_pendingState;
|
|
8
|
+
_clearWorld;
|
|
9
|
+
_clearCache;
|
|
10
|
+
_created;
|
|
11
|
+
_args;
|
|
12
|
+
current;
|
|
13
|
+
onInitCallback;
|
|
14
|
+
onPreloadCallback;
|
|
15
|
+
onCreateCallback;
|
|
16
|
+
onUpdateCallback;
|
|
17
|
+
onResizeCallback;
|
|
18
|
+
onPauseUpdateCallback;
|
|
19
|
+
onShutDownCallback;
|
|
5
20
|
/**
|
|
6
21
|
* Creates a new SceneManager instance.
|
|
7
22
|
* @param {import('./game.js').Game} game - The game instance this manager belongs to.
|