@vpmedia/phaser 1.29.0 → 1.40.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 +10 -11
- package/src/index.js +33 -33
- package/src/phaser/core/animation.js +5 -5
- package/src/phaser/core/animation_manager.js +6 -6
- package/src/phaser/core/animation_parser.js +7 -7
- package/src/phaser/core/cache.js +8 -8
- package/src/phaser/core/device_util.js +1 -1
- package/src/phaser/core/dom.js +2 -2
- package/src/phaser/core/event_manager.js +2 -2
- package/src/phaser/core/factory.js +9 -9
- package/src/phaser/core/frame.js +3 -3
- package/src/phaser/core/frame_data.js +8 -8
- package/src/phaser/core/frame_util.js +2 -2
- package/src/phaser/core/game.js +20 -20
- package/src/phaser/core/input.js +16 -16
- package/src/phaser/core/input_handler.js +21 -21
- package/src/phaser/core/input_mouse.js +1 -1
- package/src/phaser/core/input_mspointer.js +1 -1
- package/src/phaser/core/input_pointer.js +9 -9
- package/src/phaser/core/input_touch.js +1 -1
- package/src/phaser/core/loader.js +26 -23
- package/src/phaser/core/loader_parser.js +6 -6
- package/src/phaser/core/raf.js +1 -1
- package/src/phaser/core/scale_manager.js +7 -7
- package/src/phaser/core/scene_manager.js +2 -2
- package/src/phaser/core/signal.js +3 -3
- package/src/phaser/core/signal_binding.js +2 -2
- package/src/phaser/core/sound.js +2 -2
- package/src/phaser/core/sound_manager.js +5 -5
- package/src/phaser/core/sound_sprite.js +3 -3
- package/src/phaser/core/stage.js +6 -6
- package/src/phaser/core/time.js +2 -2
- package/src/phaser/core/timer.js +3 -3
- package/src/phaser/core/timer_event.js +1 -1
- package/src/phaser/core/tween.js +8 -8
- package/src/phaser/core/tween_data.js +3 -3
- package/src/phaser/core/tween_manager.js +26 -26
- package/src/phaser/core/world.js +2 -2
- package/src/phaser/display/bitmap_text.js +5 -5
- package/src/phaser/display/button.js +6 -6
- package/src/phaser/display/canvas/buffer.js +1 -1
- package/src/phaser/display/canvas/graphics.js +1 -1
- package/src/phaser/display/canvas/masker.js +2 -2
- package/src/phaser/display/canvas/renderer.js +21 -21
- package/src/phaser/display/canvas/tinter.js +3 -3
- package/src/phaser/display/canvas/util.js +1 -1
- package/src/phaser/display/display_object.js +9 -9
- package/src/phaser/display/graphics.js +24 -24
- package/src/phaser/display/graphics_data.js +1 -1
- package/src/phaser/display/graphics_data_util.js +2 -2
- package/src/phaser/display/group.js +5 -5
- package/src/phaser/display/image.js +13 -13
- package/src/phaser/display/sprite_batch.js +2 -2
- package/src/phaser/display/sprite_util.js +14 -14
- package/src/phaser/display/text.js +11 -11
- package/src/phaser/display/webgl/base_texture.js +1 -1
- package/src/phaser/display/webgl/earcut.js +1 -1
- package/src/phaser/display/webgl/fast_sprite_batch.js +1 -1
- package/src/phaser/display/webgl/filter_texture.js +1 -1
- package/src/phaser/display/webgl/graphics.js +6 -6
- package/src/phaser/display/webgl/mask_manager.js +1 -1
- package/src/phaser/display/webgl/render_texture.js +8 -8
- package/src/phaser/display/webgl/renderer.js +30 -30
- package/src/phaser/display/webgl/shader/complex.js +2 -2
- package/src/phaser/display/webgl/shader/fast.js +2 -2
- package/src/phaser/display/webgl/shader/normal.js +3 -3
- package/src/phaser/display/webgl/shader/primitive.js +2 -2
- package/src/phaser/display/webgl/shader/strip.js +2 -2
- package/src/phaser/display/webgl/shader_manager.js +5 -5
- package/src/phaser/display/webgl/sprite_batch.js +5 -5
- package/src/phaser/display/webgl/stencil_manager.js +7 -7
- package/src/phaser/display/webgl/texture.js +2 -2
- package/src/phaser/display/webgl/texture_util.js +2 -2
- package/src/phaser/geom/circle.js +5 -5
- package/src/phaser/geom/ellipse.js +4 -4
- package/src/phaser/geom/line.js +5 -5
- package/src/phaser/geom/matrix.js +3 -3
- package/src/phaser/geom/point.js +2 -2
- package/src/phaser/geom/polygon.js +3 -3
- package/src/phaser/geom/rectangle.js +3 -3
- package/src/phaser/geom/rounded_rectangle.js +2 -2
- package/src/phaser/geom/util/circle.js +3 -3
- package/src/phaser/geom/util/line.js +3 -3
- package/src/phaser/geom/util/matrix.js +1 -1
- package/src/phaser/geom/util/point.js +1 -1
- package/src/phaser/geom/util/polygon.js +1 -1
- package/src/phaser/geom/util/rectangle.js +3 -3
- package/src/phaser/geom/util/rounded_rectangle.js +1 -1
- package/types/index.d.ts +33 -33
- package/types/index.d.ts.map +1 -1
- package/types/phaser/core/animation.d.ts +11 -11
- package/types/phaser/core/animation.d.ts.map +1 -1
- package/types/phaser/core/animation_manager.d.ts +12 -12
- package/types/phaser/core/animation_manager.d.ts.map +1 -1
- package/types/phaser/core/animation_parser.d.ts +4 -4
- package/types/phaser/core/animation_parser.d.ts.map +1 -1
- package/types/phaser/core/cache.d.ts +7 -7
- package/types/phaser/core/cache.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 +3 -3
- package/types/phaser/core/dom.d.ts.map +1 -1
- package/types/phaser/core/event_manager.d.ts +4 -4
- package/types/phaser/core/event_manager.d.ts.map +1 -1
- package/types/phaser/core/factory.d.ts +9 -9
- package/types/phaser/core/factory.d.ts.map +1 -1
- package/types/phaser/core/frame.d.ts +1 -1
- package/types/phaser/core/frame.d.ts.map +1 -1
- package/types/phaser/core/frame_data.d.ts +12 -12
- package/types/phaser/core/frame_data.d.ts.map +1 -1
- package/types/phaser/core/frame_util.d.ts +2 -2
- package/types/phaser/core/frame_util.d.ts.map +1 -1
- package/types/phaser/core/game.d.ts +16 -16
- package/types/phaser/core/game.d.ts.map +1 -1
- package/types/phaser/core/input.d.ts +15 -15
- package/types/phaser/core/input.d.ts.map +1 -1
- package/types/phaser/core/input_handler.d.ts +36 -36
- package/types/phaser/core/input_handler.d.ts.map +1 -1
- package/types/phaser/core/input_mouse.d.ts +5 -5
- package/types/phaser/core/input_mouse.d.ts.map +1 -1
- package/types/phaser/core/input_mspointer.d.ts +5 -5
- package/types/phaser/core/input_mspointer.d.ts.map +1 -1
- package/types/phaser/core/input_pointer.d.ts +7 -7
- package/types/phaser/core/input_pointer.d.ts.map +1 -1
- package/types/phaser/core/input_touch.d.ts +4 -4
- package/types/phaser/core/input_touch.d.ts.map +1 -1
- package/types/phaser/core/loader.d.ts +9 -9
- package/types/phaser/core/loader.d.ts.map +1 -1
- package/types/phaser/core/loader_parser.d.ts +8 -8
- package/types/phaser/core/loader_parser.d.ts.map +1 -1
- package/types/phaser/core/raf.d.ts +3 -3
- package/types/phaser/core/raf.d.ts.map +1 -1
- package/types/phaser/core/scale_manager.d.ts +7 -7
- package/types/phaser/core/scale_manager.d.ts.map +1 -1
- package/types/phaser/core/scene_manager.d.ts +4 -4
- package/types/phaser/core/scene_manager.d.ts.map +1 -1
- package/types/phaser/core/signal.d.ts +1 -1
- package/types/phaser/core/signal.d.ts.map +1 -1
- package/types/phaser/core/signal_binding.d.ts +5 -5
- package/types/phaser/core/signal_binding.d.ts.map +1 -1
- package/types/phaser/core/sound.d.ts +5 -5
- package/types/phaser/core/sound.d.ts.map +1 -1
- package/types/phaser/core/sound_manager.d.ts +7 -7
- package/types/phaser/core/sound_manager.d.ts.map +1 -1
- package/types/phaser/core/sound_sprite.d.ts +7 -7
- package/types/phaser/core/sound_sprite.d.ts.map +1 -1
- package/types/phaser/core/stage.d.ts +4 -4
- package/types/phaser/core/stage.d.ts.map +1 -1
- package/types/phaser/core/time.d.ts +4 -4
- package/types/phaser/core/time.d.ts.map +1 -1
- package/types/phaser/core/timer.d.ts +5 -5
- package/types/phaser/core/timer.d.ts.map +1 -1
- package/types/phaser/core/timer_event.d.ts +3 -3
- package/types/phaser/core/timer_event.d.ts.map +1 -1
- package/types/phaser/core/tween.d.ts +9 -9
- package/types/phaser/core/tween.d.ts.map +1 -1
- package/types/phaser/core/tween_data.d.ts +5 -5
- package/types/phaser/core/tween_data.d.ts.map +1 -1
- package/types/phaser/core/tween_manager.d.ts +35 -35
- package/types/phaser/core/tween_manager.d.ts.map +1 -1
- package/types/phaser/core/world.d.ts +3 -3
- package/types/phaser/core/world.d.ts.map +1 -1
- package/types/phaser/display/bitmap_text.d.ts +5 -5
- package/types/phaser/display/bitmap_text.d.ts.map +1 -1
- package/types/phaser/display/button.d.ts +5 -5
- package/types/phaser/display/button.d.ts.map +1 -1
- package/types/phaser/display/canvas/renderer.d.ts +8 -8
- package/types/phaser/display/canvas/renderer.d.ts.map +1 -1
- package/types/phaser/display/display_object.d.ts +7 -7
- package/types/phaser/display/display_object.d.ts.map +1 -1
- package/types/phaser/display/graphics.d.ts +10 -10
- package/types/phaser/display/graphics.d.ts.map +1 -1
- package/types/phaser/display/graphics_data_util.d.ts +1 -1
- package/types/phaser/display/graphics_data_util.d.ts.map +1 -1
- package/types/phaser/display/group.d.ts +6 -6
- package/types/phaser/display/group.d.ts.map +1 -1
- package/types/phaser/display/image.d.ts +17 -17
- 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 +15 -15
- package/types/phaser/display/sprite_util.d.ts.map +1 -1
- package/types/phaser/display/text.d.ts +5 -5
- package/types/phaser/display/text.d.ts.map +1 -1
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts +2 -2
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/webgl/graphics.d.ts +1 -1
- package/types/phaser/display/webgl/graphics.d.ts.map +1 -1
- package/types/phaser/display/webgl/render_texture.d.ts +7 -7
- package/types/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/renderer.d.ts +15 -15
- package/types/phaser/display/webgl/renderer.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 +6 -6
- package/types/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/webgl/stencil_manager.d.ts +9 -9
- package/types/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/texture.d.ts +4 -4
- package/types/phaser/display/webgl/texture.d.ts.map +1 -1
- package/types/phaser/geom/circle.d.ts +2 -2
- package/types/phaser/geom/circle.d.ts.map +1 -1
- package/types/phaser/geom/ellipse.d.ts +2 -2
- package/types/phaser/geom/ellipse.d.ts.map +1 -1
- package/types/phaser/geom/line.d.ts +1 -1
- package/types/phaser/geom/line.d.ts.map +1 -1
- package/types/phaser/geom/matrix.d.ts +1 -1
- package/types/phaser/geom/matrix.d.ts.map +1 -1
- package/types/phaser/geom/rectangle.d.ts +1 -1
- package/types/phaser/geom/rectangle.d.ts.map +1 -1
- package/types/phaser/geom/util/circle.d.ts +2 -2
- package/types/phaser/geom/util/circle.d.ts.map +1 -1
- package/types/phaser/geom/util/line.d.ts +2 -2
- package/types/phaser/geom/util/line.d.ts.map +1 -1
- package/types/phaser/geom/util/matrix.d.ts +1 -1
- package/types/phaser/geom/util/matrix.d.ts.map +1 -1
- package/types/phaser/geom/util/point.d.ts +1 -1
- package/types/phaser/geom/util/point.d.ts.map +1 -1
- package/types/phaser/geom/util/polygon.d.ts +1 -1
- package/types/phaser/geom/util/polygon.d.ts.map +1 -1
- package/types/phaser/geom/util/rectangle.d.ts +2 -2
- package/types/phaser/geom/util/rectangle.d.ts.map +1 -1
- package/types/phaser/geom/util/rounded_rectangle.d.ts +1 -1
- package/types/phaser/geom/util/rounded_rectangle.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.40.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",
|
|
@@ -21,18 +21,17 @@
|
|
|
21
21
|
],
|
|
22
22
|
"main": "./src/index.js",
|
|
23
23
|
"types": "./types/index.d.ts",
|
|
24
|
+
"type": "module",
|
|
24
25
|
"devDependencies": {
|
|
25
|
-
"eslint": "^8.
|
|
26
|
-
"eslint-
|
|
27
|
-
"eslint-plugin-
|
|
28
|
-
"eslint-plugin-
|
|
29
|
-
"eslint-plugin-jsdoc": "^46.1.0",
|
|
30
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
26
|
+
"eslint": "^8.49.0",
|
|
27
|
+
"eslint-plugin-import": "^2.28.1",
|
|
28
|
+
"eslint-plugin-jest": "^27.2.3",
|
|
29
|
+
"eslint-plugin-jsdoc": "^46.8.0",
|
|
31
30
|
"husky": "^8.0.3",
|
|
32
|
-
"jest": "^29.
|
|
33
|
-
"lint-staged": "^
|
|
34
|
-
"prettier": "^
|
|
35
|
-
"typescript": "^5.
|
|
31
|
+
"jest": "^29.7.0",
|
|
32
|
+
"lint-staged": "^14.0.1",
|
|
33
|
+
"prettier": "^3.0.3",
|
|
34
|
+
"typescript": "^5.2.2"
|
|
36
35
|
},
|
|
37
36
|
"scripts": {
|
|
38
37
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests",
|
package/src/index.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
// core
|
|
2
|
-
import * as Const from './phaser/core/const';
|
|
3
|
-
import { Game } from './phaser/core/game';
|
|
4
|
-
import { GameObjectFactory } from './phaser/core/factory';
|
|
5
|
-
import { Signal } from './phaser/core/signal';
|
|
6
|
-
import * as MathUtils from './phaser/util/math';
|
|
2
|
+
import * as Const from './phaser/core/const.js';
|
|
3
|
+
import { Game } from './phaser/core/game.js';
|
|
4
|
+
import { GameObjectFactory } from './phaser/core/factory.js';
|
|
5
|
+
import { Signal } from './phaser/core/signal.js';
|
|
6
|
+
import * as MathUtils from './phaser/util/math.js';
|
|
7
7
|
// sound
|
|
8
|
-
import { Sound } from './phaser/core/sound';
|
|
9
|
-
import { SoundSprite } from './phaser/core/sound_sprite';
|
|
10
|
-
import { SoundManager } from './phaser/core/sound_manager';
|
|
8
|
+
import { Sound } from './phaser/core/sound.js';
|
|
9
|
+
import { SoundSprite } from './phaser/core/sound_sprite.js';
|
|
10
|
+
import { SoundManager } from './phaser/core/sound_manager.js';
|
|
11
11
|
// time
|
|
12
|
-
import { Time } from './phaser/core/time';
|
|
13
|
-
import { Timer } from './phaser/core/timer';
|
|
14
|
-
import { TimerEvent } from './phaser/core/timer_event';
|
|
12
|
+
import { Time } from './phaser/core/time.js';
|
|
13
|
+
import { Timer } from './phaser/core/timer.js';
|
|
14
|
+
import { TimerEvent } from './phaser/core/timer_event.js';
|
|
15
15
|
// tween
|
|
16
|
-
import { Tween } from './phaser/core/tween';
|
|
17
|
-
import { TweenData } from './phaser/core/tween_data';
|
|
18
|
-
import { TweenManager } from './phaser/core/tween_manager';
|
|
16
|
+
import { Tween } from './phaser/core/tween.js';
|
|
17
|
+
import { TweenData } from './phaser/core/tween_data.js';
|
|
18
|
+
import { TweenManager } from './phaser/core/tween_manager.js';
|
|
19
19
|
// animation
|
|
20
|
-
import { Animation } from './phaser/core/animation';
|
|
21
|
-
import { AnimationManager } from './phaser/core/animation_manager';
|
|
20
|
+
import { Animation } from './phaser/core/animation.js';
|
|
21
|
+
import { AnimationManager } from './phaser/core/animation_manager.js';
|
|
22
22
|
// texture
|
|
23
|
-
import { BaseTexture } from './phaser/display/webgl/base_texture';
|
|
24
|
-
import { Texture } from './phaser/display/webgl/texture';
|
|
23
|
+
import { BaseTexture } from './phaser/display/webgl/base_texture.js';
|
|
24
|
+
import { Texture } from './phaser/display/webgl/texture.js';
|
|
25
25
|
// geom
|
|
26
|
-
import { Circle } from './phaser/geom/circle';
|
|
27
|
-
import { Ellipse } from './phaser/geom/ellipse';
|
|
28
|
-
import { Line } from './phaser/geom/line';
|
|
29
|
-
import { Matrix } from './phaser/geom/matrix';
|
|
30
|
-
import { Point } from './phaser/geom/point';
|
|
31
|
-
import { Polygon } from './phaser/geom/polygon';
|
|
32
|
-
import { Rectangle } from './phaser/geom/rectangle';
|
|
33
|
-
import { RoundedRectangle } from './phaser/geom/rounded_rectangle';
|
|
26
|
+
import { Circle } from './phaser/geom/circle.js';
|
|
27
|
+
import { Ellipse } from './phaser/geom/ellipse.js';
|
|
28
|
+
import { Line } from './phaser/geom/line.js';
|
|
29
|
+
import { Matrix } from './phaser/geom/matrix.js';
|
|
30
|
+
import { Point } from './phaser/geom/point.js';
|
|
31
|
+
import { Polygon } from './phaser/geom/polygon.js';
|
|
32
|
+
import { Rectangle } from './phaser/geom/rectangle.js';
|
|
33
|
+
import { RoundedRectangle } from './phaser/geom/rounded_rectangle.js';
|
|
34
34
|
// display
|
|
35
|
-
import { BitmapText } from './phaser/display/bitmap_text';
|
|
36
|
-
import { DisplayObject } from './phaser/display/display_object';
|
|
37
|
-
import { Button } from './phaser/display/button';
|
|
38
|
-
import { Image } from './phaser/display/image';
|
|
39
|
-
import { Group } from './phaser/display/group';
|
|
40
|
-
import { Text } from './phaser/display/text';
|
|
41
|
-
import { Graphics } from './phaser/display/graphics';
|
|
35
|
+
import { BitmapText } from './phaser/display/bitmap_text.js';
|
|
36
|
+
import { DisplayObject } from './phaser/display/display_object.js';
|
|
37
|
+
import { Button } from './phaser/display/button.js';
|
|
38
|
+
import { Image } from './phaser/display/image.js';
|
|
39
|
+
import { Group } from './phaser/display/group.js';
|
|
40
|
+
import { Text } from './phaser/display/text.js';
|
|
41
|
+
import { Graphics } from './phaser/display/graphics.js';
|
|
42
42
|
// exports
|
|
43
43
|
export {
|
|
44
44
|
Const,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Signal } from './signal';
|
|
1
|
+
import { Signal } from './signal.js';
|
|
2
2
|
|
|
3
3
|
export class Animation {
|
|
4
4
|
/**
|
|
5
5
|
* TBD.
|
|
6
|
-
* @param {import('./game').Game} game - TBD.
|
|
7
|
-
* @param {import('../display/image').Image} parent - TBD.
|
|
6
|
+
* @param {import('./game.js').Game} game - TBD.
|
|
7
|
+
* @param {import('../display/image.js').Image} parent - TBD.
|
|
8
8
|
* @param {string} name - TBD.
|
|
9
|
-
* @param {import('./frame_data').FrameData} frameData - TBD.
|
|
9
|
+
* @param {import('./frame_data.js').FrameData} frameData - TBD.
|
|
10
10
|
* @param {string[]|number[]} frames - TBD.
|
|
11
11
|
* @param {number} frameRate - TBD.
|
|
12
12
|
* @param {boolean} loop - TBD.
|
|
@@ -302,7 +302,7 @@ export class Animation {
|
|
|
302
302
|
|
|
303
303
|
/**
|
|
304
304
|
* TBD.
|
|
305
|
-
* @param {import('./frame_data').FrameData} frameData - TBD.
|
|
305
|
+
* @param {import('./frame_data.js').FrameData} frameData - TBD.
|
|
306
306
|
*/
|
|
307
307
|
updateFrameData(frameData) {
|
|
308
308
|
this._frameData = frameData;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Animation } from './animation';
|
|
1
|
+
import { Animation } from './animation.js';
|
|
2
2
|
|
|
3
3
|
export class AnimationManager {
|
|
4
4
|
/**
|
|
5
5
|
* TBD.
|
|
6
|
-
* @param {import('../display/image').Image} sprite - TBD.
|
|
6
|
+
* @param {import('../display/image.js').Image} sprite - TBD.
|
|
7
7
|
*/
|
|
8
8
|
constructor(sprite) {
|
|
9
9
|
this.sprite = sprite;
|
|
@@ -36,7 +36,7 @@ export class AnimationManager {
|
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* TBD.
|
|
39
|
-
* @param {import('./frame_data').FrameData} frameData - TBD.
|
|
39
|
+
* @param {import('./frame_data.js').FrameData} frameData - TBD.
|
|
40
40
|
* @param {string|number} frame - TBD.
|
|
41
41
|
* @returns {boolean} TBD.
|
|
42
42
|
*/
|
|
@@ -66,7 +66,7 @@ export class AnimationManager {
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* TBD.
|
|
69
|
-
* @param {import('./frame_data').FrameData} frameData - TBD.
|
|
69
|
+
* @param {import('./frame_data.js').FrameData} frameData - TBD.
|
|
70
70
|
* @param {string|number} frame - TBD.
|
|
71
71
|
* @returns {boolean} TBD.
|
|
72
72
|
*/
|
|
@@ -119,7 +119,7 @@ export class AnimationManager {
|
|
|
119
119
|
this._frameData,
|
|
120
120
|
this._outputFrames,
|
|
121
121
|
frameRate,
|
|
122
|
-
loop
|
|
122
|
+
loop,
|
|
123
123
|
);
|
|
124
124
|
this.currentAnim = this._anims[name];
|
|
125
125
|
if (this.sprite.tilingTexture) {
|
|
@@ -245,7 +245,7 @@ export class AnimationManager {
|
|
|
245
245
|
|
|
246
246
|
/**
|
|
247
247
|
* TBD.
|
|
248
|
-
* @returns {import('./frame_data').FrameData} TBD.
|
|
248
|
+
* @returns {import('./frame_data.js').FrameData} TBD.
|
|
249
249
|
*/
|
|
250
250
|
get frameData() {
|
|
251
251
|
return this._frameData;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Frame } from './frame';
|
|
2
|
-
import { FrameData } from './frame_data';
|
|
1
|
+
import { Frame } from './frame.js';
|
|
2
|
+
import { FrameData } from './frame_data.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* TBD.
|
|
6
|
-
* @param {import('./game').Game} game - TBD.
|
|
6
|
+
* @param {import('./game.js').Game} game - TBD.
|
|
7
7
|
* @param {string} key - TBD.
|
|
8
8
|
* @param {number} frameWidth - TBD.
|
|
9
9
|
* @param {number} frameHeight - TBD.
|
|
@@ -37,7 +37,7 @@ export function spriteSheet(game, key, frameWidth, frameHeight, frameMax, margin
|
|
|
37
37
|
// Zero or smaller than frame sizes?
|
|
38
38
|
if (width === 0 || height === 0 || width < frameWidth || height < frameHeight || total === 0) {
|
|
39
39
|
console.warn(
|
|
40
|
-
"AnimationParser.spriteSheet: '" + key + "'s width/height zero or width/height < given frameWidth/frameHeight"
|
|
40
|
+
"AnimationParser.spriteSheet: '" + key + "'s width/height zero or width/height < given frameWidth/frameHeight",
|
|
41
41
|
);
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
@@ -58,7 +58,7 @@ export function spriteSheet(game, key, frameWidth, frameHeight, frameMax, margin
|
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* TBD.
|
|
61
|
-
* @param {import('./game').Game} game - TBD.
|
|
61
|
+
* @param {import('./game.js').Game} game - TBD.
|
|
62
62
|
* @param {object} json - TBD.
|
|
63
63
|
* @returns {object} TBD.
|
|
64
64
|
*/
|
|
@@ -77,7 +77,7 @@ export function JSONDataHash(game, json) {
|
|
|
77
77
|
for (let k = 0; k < keys.length; k += 1) {
|
|
78
78
|
const key = keys[k];
|
|
79
79
|
newFrame = data.addFrame(
|
|
80
|
-
new Frame(i, frames[key].frame.x, frames[key].frame.y, frames[key].frame.w, frames[key].frame.h, key)
|
|
80
|
+
new Frame(i, frames[key].frame.x, frames[key].frame.y, frames[key].frame.w, frames[key].frame.h, key),
|
|
81
81
|
);
|
|
82
82
|
if (frames[key].trimmed) {
|
|
83
83
|
newFrame.setTrim(
|
|
@@ -87,7 +87,7 @@ export function JSONDataHash(game, json) {
|
|
|
87
87
|
frames[key].spriteSourceSize.x,
|
|
88
88
|
frames[key].spriteSourceSize.y,
|
|
89
89
|
frames[key].spriteSourceSize.w,
|
|
90
|
-
frames[key].spriteSourceSize.h
|
|
90
|
+
frames[key].spriteSourceSize.h,
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
93
|
i += 1;
|
package/src/phaser/core/cache.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Frame } from './frame';
|
|
5
|
-
import { FrameData } from './frame_data';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { BaseTexture } from '../display/webgl/base_texture.js';
|
|
2
|
+
import { Texture } from '../display/webgl/texture.js';
|
|
3
|
+
import { JSONDataHash } from './animation_parser.js';
|
|
4
|
+
import { Frame } from './frame.js';
|
|
5
|
+
import { FrameData } from './frame_data.js';
|
|
6
|
+
import { jsonBitmapFont, xmlBitmapFont } from './loader_parser.js';
|
|
7
|
+
import { Signal } from './signal.js';
|
|
8
8
|
|
|
9
9
|
export const CANVAS = 0;
|
|
10
10
|
export const IMAGE = 1;
|
|
@@ -20,7 +20,7 @@ export const RENDER_TEXTURE = 9;
|
|
|
20
20
|
export class Cache {
|
|
21
21
|
/**
|
|
22
22
|
* TBD.
|
|
23
|
-
* @param {import('./game').Game} game - TBD.
|
|
23
|
+
* @param {import('./game.js').Game} game - TBD.
|
|
24
24
|
*/
|
|
25
25
|
constructor(game) {
|
|
26
26
|
this.game = game;
|
package/src/phaser/core/dom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Point } from '../geom/point';
|
|
1
|
+
import { Point } from '../geom/point.js';
|
|
2
2
|
|
|
3
3
|
class VisualBoundsDesktopRectangle {
|
|
4
4
|
/**
|
|
@@ -182,7 +182,7 @@ class DocumentBoundsRectangle {
|
|
|
182
182
|
export class DOM {
|
|
183
183
|
/**
|
|
184
184
|
* TBD.
|
|
185
|
-
* @param {import('./device').Device} device - TBD.
|
|
185
|
+
* @param {import('./device.js').Device} device - TBD.
|
|
186
186
|
*/
|
|
187
187
|
constructor(device) {
|
|
188
188
|
this.treatAsDesktop =
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Signal } from './signal';
|
|
1
|
+
import { Signal } from './signal.js';
|
|
2
2
|
|
|
3
3
|
export class EventManager {
|
|
4
4
|
/**
|
|
5
5
|
* TBD.
|
|
6
|
-
* @param {import('../display/display_object').DisplayObject} sprite - TBD.
|
|
6
|
+
* @param {import('../display/display_object.js').DisplayObject} sprite - TBD.
|
|
7
7
|
*/
|
|
8
8
|
constructor(sprite) {
|
|
9
9
|
this.parent = sprite;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { BitmapText } from '../display/bitmap_text';
|
|
2
|
-
import { Button } from '../display/button';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Image } from '../display/image';
|
|
6
|
-
import { Text } from '../display/text';
|
|
1
|
+
import { BitmapText } from '../display/bitmap_text.js';
|
|
2
|
+
import { Button } from '../display/button.js';
|
|
3
|
+
import { Graphics } from '../display/graphics.js';
|
|
4
|
+
import { Group } from '../display/group.js';
|
|
5
|
+
import { Image } from '../display/image.js';
|
|
6
|
+
import { Text } from '../display/text.js';
|
|
7
7
|
|
|
8
8
|
export class GameObjectFactory {
|
|
9
9
|
/**
|
|
10
10
|
* TBD.
|
|
11
|
-
* @param {import('./game').Game} game - TBD.
|
|
11
|
+
* @param {import('./game.js').Game} game - TBD.
|
|
12
12
|
*/
|
|
13
13
|
constructor(game) {
|
|
14
14
|
this.game = game;
|
|
@@ -79,11 +79,11 @@ export class GameObjectFactory {
|
|
|
79
79
|
outFrame = null,
|
|
80
80
|
downFrame = null,
|
|
81
81
|
upFrame = null,
|
|
82
|
-
group = null
|
|
82
|
+
group = null,
|
|
83
83
|
) {
|
|
84
84
|
const parent = group || this.game.world;
|
|
85
85
|
return parent.add(
|
|
86
|
-
new Button(this.game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame)
|
|
86
|
+
new Button(this.game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame),
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
|
package/src/phaser/core/frame.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Rectangle } from '../geom/rectangle';
|
|
2
|
-
import { distance } from '../util/math';
|
|
3
|
-
import { cloneFrame } from './frame_util';
|
|
1
|
+
import { Rectangle } from '../geom/rectangle.js';
|
|
2
|
+
import { distance } from '../util/math.js';
|
|
3
|
+
import { cloneFrame } from './frame_util.js';
|
|
4
4
|
|
|
5
5
|
export class Frame {
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cloneFrameData } from './frame_util';
|
|
1
|
+
import { cloneFrameData } from './frame_util.js';
|
|
2
2
|
|
|
3
3
|
export class FrameData {
|
|
4
4
|
/**
|
|
@@ -6,7 +6,7 @@ export class FrameData {
|
|
|
6
6
|
*/
|
|
7
7
|
constructor() {
|
|
8
8
|
/**
|
|
9
|
-
* @type {import('./frame').Frame[]}
|
|
9
|
+
* @type {import('./frame.js').Frame[]}
|
|
10
10
|
*/
|
|
11
11
|
this._frames = [];
|
|
12
12
|
/**
|
|
@@ -17,8 +17,8 @@ export class FrameData {
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* TBD.
|
|
20
|
-
* @param {import('./frame').Frame} frame - TBD.
|
|
21
|
-
* @returns {import('./frame').Frame} TBD.
|
|
20
|
+
* @param {import('./frame.js').Frame} frame - TBD.
|
|
21
|
+
* @returns {import('./frame.js').Frame} TBD.
|
|
22
22
|
*/
|
|
23
23
|
addFrame(frame) {
|
|
24
24
|
frame.index = this._frames.length;
|
|
@@ -32,7 +32,7 @@ export class FrameData {
|
|
|
32
32
|
/**
|
|
33
33
|
* TBD.
|
|
34
34
|
* @param {number} index - TBD.
|
|
35
|
-
* @returns {import('./frame').Frame} TBD.
|
|
35
|
+
* @returns {import('./frame.js').Frame} TBD.
|
|
36
36
|
*/
|
|
37
37
|
getFrame(index = 0) {
|
|
38
38
|
if (index >= this._frames.length) {
|
|
@@ -44,7 +44,7 @@ export class FrameData {
|
|
|
44
44
|
/**
|
|
45
45
|
* TBD.
|
|
46
46
|
* @param {string} name - TBD.
|
|
47
|
-
* @returns {import('./frame').Frame} TBD.
|
|
47
|
+
* @returns {import('./frame.js').Frame} TBD.
|
|
48
48
|
*/
|
|
49
49
|
getFrameByName(name) {
|
|
50
50
|
if (typeof this._frameNames[name] === 'number') {
|
|
@@ -77,8 +77,8 @@ export class FrameData {
|
|
|
77
77
|
* TBD.
|
|
78
78
|
* @param {number} start - TBD.
|
|
79
79
|
* @param {number} end - TBD.
|
|
80
|
-
* @param {import('./frame').Frame[]} output - TBD.
|
|
81
|
-
* @returns {import('./frame').Frame[]} TBD.
|
|
80
|
+
* @param {import('./frame.js').Frame[]} output - TBD.
|
|
81
|
+
* @returns {import('./frame.js').Frame[]} TBD.
|
|
82
82
|
*/
|
|
83
83
|
getFrameRange(start, end, output = null) {
|
|
84
84
|
const result = output || [];
|
package/src/phaser/core/game.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { CanvasRenderer } from '../display/canvas/renderer';
|
|
2
|
-
import { WebGLRenderer } from '../display/webgl/renderer';
|
|
3
|
-
import { Signal } from './signal';
|
|
4
|
-
import { Loader } from './loader';
|
|
5
|
-
import { Cache } from './cache';
|
|
6
|
-
import { Input } from './input';
|
|
7
|
-
import { Device } from './device';
|
|
8
|
-
import { GameObjectFactory } from './factory';
|
|
9
|
-
import { RequestAnimationFrame } from './raf';
|
|
10
|
-
import { ScaleManager } from './scale_manager';
|
|
11
|
-
import { SoundManager } from './sound_manager';
|
|
12
|
-
import { SceneManager } from './scene_manager';
|
|
13
|
-
import { Time } from './time';
|
|
14
|
-
import { TweenManager } from './tween_manager';
|
|
15
|
-
import { World } from './world';
|
|
16
|
-
import { Stage } from './stage';
|
|
17
|
-
import { RENDER_AUTO, RENDER_WEBGL } from './const';
|
|
18
|
-
import { create, removeFromDOM, addToDOM, setTouchAction } from '../display/canvas/util';
|
|
19
|
-
import { initialize, checkOS } from './device_util';
|
|
1
|
+
import { CanvasRenderer } from '../display/canvas/renderer.js';
|
|
2
|
+
import { WebGLRenderer } from '../display/webgl/renderer.js';
|
|
3
|
+
import { Signal } from './signal.js';
|
|
4
|
+
import { Loader } from './loader.js';
|
|
5
|
+
import { Cache } from './cache.js';
|
|
6
|
+
import { Input } from './input.js';
|
|
7
|
+
import { Device } from './device.js';
|
|
8
|
+
import { GameObjectFactory } from './factory.js';
|
|
9
|
+
import { RequestAnimationFrame } from './raf.js';
|
|
10
|
+
import { ScaleManager } from './scale_manager.js';
|
|
11
|
+
import { SoundManager } from './sound_manager.js';
|
|
12
|
+
import { SceneManager } from './scene_manager.js';
|
|
13
|
+
import { Time } from './time.js';
|
|
14
|
+
import { TweenManager } from './tween_manager.js';
|
|
15
|
+
import { World } from './world.js';
|
|
16
|
+
import { Stage } from './stage.js';
|
|
17
|
+
import { RENDER_AUTO, RENDER_WEBGL } from './const.js';
|
|
18
|
+
import { create, removeFromDOM, addToDOM, setTouchAction } from '../display/canvas/util.js';
|
|
19
|
+
import { initialize, checkOS } from './device_util.js';
|
|
20
20
|
|
|
21
21
|
export class Game {
|
|
22
22
|
/**
|
|
@@ -66,7 +66,7 @@ export class Game {
|
|
|
66
66
|
initialize(this.device);
|
|
67
67
|
this.boot();
|
|
68
68
|
},
|
|
69
|
-
false
|
|
69
|
+
false,
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
}
|
package/src/phaser/core/input.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Graphics } from '../display/graphics';
|
|
3
|
-
import { Image } from '../display/image';
|
|
4
|
-
import {
|
|
5
|
-
import { Point } from '../geom/point';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { create, remove } from '../display/canvas/pool.js';
|
|
2
|
+
import { Graphics } from '../display/graphics.js';
|
|
3
|
+
import { Image } from '../display/image.js';
|
|
4
|
+
import { Circle } from '../geom/circle.js';
|
|
5
|
+
import { Point } from '../geom/point.js';
|
|
6
|
+
import { ArraySet } from './array_set.js';
|
|
7
|
+
import { MOUSE_TOUCH_COMBINE, POINTER_CONTACT, POINTER_CURSOR } from './const.js';
|
|
8
|
+
import { Mouse } from './input_mouse.js';
|
|
9
|
+
import { MSPointer } from './input_mspointer.js';
|
|
10
|
+
import { Pointer } from './input_pointer.js';
|
|
11
|
+
import { Touch } from './input_touch.js';
|
|
12
|
+
import { Signal } from './signal.js';
|
|
13
13
|
|
|
14
14
|
const MAX_POINTERS = 10;
|
|
15
15
|
|
|
16
16
|
export class Input {
|
|
17
17
|
/**
|
|
18
18
|
* TBD.
|
|
19
|
-
* @param {import('./game').Game} game - TBD.
|
|
19
|
+
* @param {import('./game.js').Game} game - TBD.
|
|
20
20
|
*/
|
|
21
21
|
constructor(game) {
|
|
22
22
|
this.game = game;
|
|
@@ -360,7 +360,7 @@ export class Input {
|
|
|
360
360
|
|
|
361
361
|
/**
|
|
362
362
|
* TBD.
|
|
363
|
-
* @param {import('../display/display_object').DisplayObject} displayObject - TBD.
|
|
363
|
+
* @param {import('../display/display_object.js').DisplayObject} displayObject - TBD.
|
|
364
364
|
* @param {Pointer} pointer - TBD.
|
|
365
365
|
* @param {Point} output - TBD.
|
|
366
366
|
* @returns {Point} TBD.
|
|
@@ -371,13 +371,13 @@ export class Input {
|
|
|
371
371
|
const id = 1 / (wt.a * wt.d + wt.c * -wt.b);
|
|
372
372
|
return result.setTo(
|
|
373
373
|
wt.d * id * pointer.x + -wt.c * id * pointer.y + (wt.ty * wt.c - wt.tx * wt.d) * id,
|
|
374
|
-
wt.a * id * pointer.y + -wt.b * id * pointer.x + (-wt.ty * wt.a + wt.tx * wt.b) * id
|
|
374
|
+
wt.a * id * pointer.y + -wt.b * id * pointer.x + (-wt.ty * wt.a + wt.tx * wt.b) * id,
|
|
375
375
|
);
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
/**
|
|
379
379
|
* TBD.
|
|
380
|
-
* @param {import('../display/display_object').DisplayObject} displayObject - TBD.
|
|
380
|
+
* @param {import('../display/display_object.js').DisplayObject} displayObject - TBD.
|
|
381
381
|
* @param {Pointer} pointer - TBD.
|
|
382
382
|
* @param {Point} localPoint - TBD.
|
|
383
383
|
* @returns {boolean} TBD.
|