@vpmedia/phaser 1.15.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +6 -5
- package/src/index.js +15 -18
- package/src/phaser/core/animation.js +102 -6
- package/src/phaser/core/animation_manager.js +88 -10
- package/src/phaser/core/animation_parser.js +5 -18
- package/src/phaser/core/array_set.js +51 -5
- package/src/phaser/core/cache.js +291 -6
- package/src/phaser/core/const.js +107 -4
- package/src/phaser/core/device.js +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 +116 -17
- package/src/phaser/core/input_handler.js +242 -42
- package/src/phaser/core/input_mouse.js +66 -5
- package/src/phaser/core/input_mspointer.js +40 -9
- package/src/phaser/core/input_pointer.js +79 -17
- package/src/phaser/core/input_touch.js +42 -5
- package/src/phaser/core/loader.js +274 -101
- package/src/phaser/core/loader_parser.js +2 -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 +74 -9
- package/src/phaser/display/image.js +85 -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 +105 -4
- package/types/phaser/core/animation.d.ts.map +1 -1
- package/types/phaser/core/animation_manager.d.ts +87 -0
- package/types/phaser/core/animation_manager.d.ts.map +1 -1
- package/types/phaser/core/animation_parser.d.ts +5 -4
- package/types/phaser/core/animation_parser.d.ts.map +1 -1
- package/types/phaser/core/array_set.d.ts +53 -7
- package/types/phaser/core/array_set.d.ts.map +1 -1
- package/types/phaser/core/cache.d.ts +346 -56
- 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 +74 -7
- 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 +114 -3
- package/types/phaser/core/input.d.ts.map +1 -1
- package/types/phaser/core/input_handler.d.ts +257 -24
- package/types/phaser/core/input_handler.d.ts.map +1 -1
- package/types/phaser/core/input_mouse.d.ts +51 -4
- package/types/phaser/core/input_mouse.d.ts.map +1 -1
- package/types/phaser/core/input_mspointer.d.ts +43 -9
- package/types/phaser/core/input_mspointer.d.ts.map +1 -1
- package/types/phaser/core/input_pointer.d.ts +78 -2
- package/types/phaser/core/input_pointer.d.ts.map +1 -1
- package/types/phaser/core/input_touch.d.ts +45 -8
- package/types/phaser/core/input_touch.d.ts.map +1 -1
- package/types/phaser/core/loader.d.ts +264 -19
- 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 +17 -7
- package/types/phaser/core/raf.d.ts.map +1 -1
- package/types/phaser/core/scale_manager.d.ts +201 -6
- 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 +93 -7
- package/types/phaser/core/sound_manager.d.ts.map +1 -1
- package/types/phaser/core/sound_sprite.d.ts +22 -8
- package/types/phaser/core/sound_sprite.d.ts.map +1 -1
- package/types/phaser/core/stage.d.ts +32 -3
- package/types/phaser/core/stage.d.ts.map +1 -1
- package/types/phaser/core/time.d.ts +73 -6
- package/types/phaser/core/time.d.ts.map +1 -1
- package/types/phaser/core/timer.d.ts +103 -2
- package/types/phaser/core/timer.d.ts.map +1 -1
- package/types/phaser/core/timer_event.d.ts +11 -5
- package/types/phaser/core/timer_event.d.ts.map +1 -1
- package/types/phaser/core/tween.d.ts +122 -2
- 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 +62 -0
- package/types/phaser/display/group.d.ts.map +1 -1
- package/types/phaser/display/image.d.ts +66 -2
- 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,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 { Texture } from '../display/webgl/texture';
|
|
7
|
-
import { Rectangle } from
|
|
2
|
+
import { Rectangle } from '../geom/rectangle';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* TBD.
|
|
@@ -15,10 +10,7 @@ import { Rectangle } from '../geom/rectangle';
|
|
|
15
10
|
export function finalizeBitmapFont(baseTexture, bitmapFontData) {
|
|
16
11
|
Object.keys(bitmapFontData.chars).forEach((charCode) => {
|
|
17
12
|
const letter = bitmapFontData.chars[charCode];
|
|
18
|
-
letter.texture = new Texture(
|
|
19
|
-
baseTexture,
|
|
20
|
-
new Rectangle(letter.x, letter.y, letter.width, letter.height)
|
|
21
|
-
);
|
|
13
|
+
letter.texture = new Texture(baseTexture, new Rectangle(letter.x, letter.y, letter.width, letter.height));
|
|
22
14
|
});
|
|
23
15
|
return bitmapFontData;
|
|
24
16
|
}
|
package/src/phaser/core/raf.js
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
4
|
-
* @author Richard Davey <rich@photonstorm.com>
|
|
5
|
-
*/
|
|
1
|
+
import { Game } from './game';
|
|
2
|
+
|
|
6
3
|
export class RequestAnimationFrame {
|
|
4
|
+
/**
|
|
5
|
+
* TBD.
|
|
6
|
+
* @param {Game} game - TBD.
|
|
7
|
+
*/
|
|
7
8
|
constructor(game) {
|
|
8
9
|
this.game = game;
|
|
9
10
|
this.rafId = 0;
|
|
10
11
|
this.updateBinded = this.update.bind(this);
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
/**
|
|
15
|
+
* TBD.
|
|
16
|
+
*/
|
|
13
17
|
start() {
|
|
14
18
|
this.rafId = requestAnimationFrame(this.updateBinded);
|
|
15
19
|
}
|
|
16
20
|
|
|
21
|
+
/**
|
|
22
|
+
* TBD.
|
|
23
|
+
*/
|
|
17
24
|
stop() {
|
|
18
25
|
cancelAnimationFrame(this.rafId);
|
|
19
26
|
}
|
|
20
27
|
|
|
28
|
+
/**
|
|
29
|
+
* TBD.
|
|
30
|
+
* @param rafTime
|
|
31
|
+
*/
|
|
21
32
|
update(rafTime) {
|
|
22
33
|
this.game.update(rafTime);
|
|
23
34
|
this.rafId = requestAnimationFrame(this.updateBinded);
|
|
@@ -1,22 +1,17 @@
|
|
|
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
|
-
import { Signal } from './signal';
|
|
1
|
+
import { Signal } from './signal';
|
|
7
2
|
import { DOM } from './dom';
|
|
8
3
|
import { Point } from '../geom/point';
|
|
9
|
-
import { Rectangle } from
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
SCALE_RESIZE,
|
|
13
|
-
SCALE_EXACT_FIT,
|
|
14
|
-
SCALE_USER,
|
|
15
|
-
SCALE_SHOW_ALL,
|
|
16
|
-
RENDER_CANVAS,
|
|
17
|
-
} from './const';
|
|
4
|
+
import { Rectangle } from '../geom/rectangle';
|
|
5
|
+
import { SCALE_OFF, SCALE_RESIZE, SCALE_EXACT_FIT, SCALE_USER, SCALE_SHOW_ALL, RENDER_CANVAS } from './const';
|
|
6
|
+
import { Game } from './game';
|
|
18
7
|
|
|
19
8
|
export class ScaleManager {
|
|
9
|
+
/**
|
|
10
|
+
* TBD.
|
|
11
|
+
* @param {Game} game - TBD.
|
|
12
|
+
* @param {number} width - TBD.
|
|
13
|
+
* @param {number} height - TBD.
|
|
14
|
+
*/
|
|
20
15
|
constructor(game, width, height) {
|
|
21
16
|
this.game = game;
|
|
22
17
|
this.dom = new DOM(game.device);
|
|
@@ -95,6 +90,9 @@ export class ScaleManager {
|
|
|
95
90
|
this.setupScale(width, height);
|
|
96
91
|
}
|
|
97
92
|
|
|
93
|
+
/**
|
|
94
|
+
* TBD.
|
|
95
|
+
*/
|
|
98
96
|
boot() {
|
|
99
97
|
// Configure device-dependent compatibility
|
|
100
98
|
const compat = this.compatibility;
|
|
@@ -139,6 +137,10 @@ export class ScaleManager {
|
|
|
139
137
|
}
|
|
140
138
|
}
|
|
141
139
|
|
|
140
|
+
/**
|
|
141
|
+
* TBD.
|
|
142
|
+
* @param config
|
|
143
|
+
*/
|
|
142
144
|
parseConfig(config) {
|
|
143
145
|
if (config.scaleMode !== undefined) {
|
|
144
146
|
if (this._booted) {
|
|
@@ -157,6 +159,11 @@ export class ScaleManager {
|
|
|
157
159
|
}
|
|
158
160
|
}
|
|
159
161
|
|
|
162
|
+
/**
|
|
163
|
+
* TBD.
|
|
164
|
+
* @param {number} width - TBD.
|
|
165
|
+
* @param {number} height - TBD.
|
|
166
|
+
*/
|
|
160
167
|
setupScale(width, height) {
|
|
161
168
|
let target;
|
|
162
169
|
const rect = new Rectangle();
|
|
@@ -207,10 +214,18 @@ export class ScaleManager {
|
|
|
207
214
|
this.updateDimensions(newWidth, newHeight, false);
|
|
208
215
|
}
|
|
209
216
|
|
|
217
|
+
/**
|
|
218
|
+
* TBD.
|
|
219
|
+
*/
|
|
210
220
|
_gameResumed() {
|
|
211
221
|
this.queueUpdate(true);
|
|
212
222
|
}
|
|
213
223
|
|
|
224
|
+
/**
|
|
225
|
+
* TBD.
|
|
226
|
+
* @param {number} width - TBD.
|
|
227
|
+
* @param {number} height - TBD.
|
|
228
|
+
*/
|
|
214
229
|
setGameSize(width, height) {
|
|
215
230
|
this._gameSize.setTo(0, 0, width, height);
|
|
216
231
|
if (this.currentScaleMode !== SCALE_RESIZE) {
|
|
@@ -219,17 +234,32 @@ export class ScaleManager {
|
|
|
219
234
|
this.queueUpdate(true);
|
|
220
235
|
}
|
|
221
236
|
|
|
237
|
+
/**
|
|
238
|
+
* TBD.
|
|
239
|
+
* @param hScale
|
|
240
|
+
* @param vScale
|
|
241
|
+
* @param hTrim
|
|
242
|
+
* @param vTrim
|
|
243
|
+
*/
|
|
222
244
|
setUserScale(hScale, vScale, hTrim, vTrim) {
|
|
223
245
|
this._userScaleFactor.setTo(hScale, vScale);
|
|
224
246
|
this._userScaleTrim.setTo(hTrim | 0, vTrim | 0);
|
|
225
247
|
this.queueUpdate(true);
|
|
226
248
|
}
|
|
227
249
|
|
|
250
|
+
/**
|
|
251
|
+
* TBD.
|
|
252
|
+
* @param callback - TBD.
|
|
253
|
+
* @param context
|
|
254
|
+
*/
|
|
228
255
|
setResizeCallback(callback, context) {
|
|
229
256
|
this.onResize = callback;
|
|
230
257
|
this.onResizeContext = context;
|
|
231
258
|
}
|
|
232
259
|
|
|
260
|
+
/**
|
|
261
|
+
* TBD.
|
|
262
|
+
*/
|
|
233
263
|
signalSizeChange() {
|
|
234
264
|
if (
|
|
235
265
|
this.width !== this._lastReportedCanvasSize.width ||
|
|
@@ -250,6 +280,13 @@ export class ScaleManager {
|
|
|
250
280
|
}
|
|
251
281
|
}
|
|
252
282
|
|
|
283
|
+
/**
|
|
284
|
+
* TBD.
|
|
285
|
+
* @param minWidth
|
|
286
|
+
* @param minHeight
|
|
287
|
+
* @param maxWidth
|
|
288
|
+
* @param maxHeight
|
|
289
|
+
*/
|
|
253
290
|
setMinMax(minWidth, minHeight, maxWidth, maxHeight) {
|
|
254
291
|
this.minWidth = minWidth;
|
|
255
292
|
this.minHeight = minHeight;
|
|
@@ -261,6 +298,9 @@ export class ScaleManager {
|
|
|
261
298
|
}
|
|
262
299
|
}
|
|
263
300
|
|
|
301
|
+
/**
|
|
302
|
+
* TBD.
|
|
303
|
+
*/
|
|
264
304
|
preUpdate() {
|
|
265
305
|
if (this.game.time.time < this._lastUpdate + this._updateThrottle) {
|
|
266
306
|
return;
|
|
@@ -291,12 +331,21 @@ export class ScaleManager {
|
|
|
291
331
|
this._lastUpdate = this.game.time.time;
|
|
292
332
|
}
|
|
293
333
|
|
|
334
|
+
/**
|
|
335
|
+
* TBD.
|
|
336
|
+
*/
|
|
294
337
|
pauseUpdate() {
|
|
295
338
|
this.preUpdate();
|
|
296
339
|
// Updates at slowest.
|
|
297
340
|
this._updateThrottle = this.trackParentInterval;
|
|
298
341
|
}
|
|
299
342
|
|
|
343
|
+
/**
|
|
344
|
+
* TBD.
|
|
345
|
+
* @param {number} width - TBD.
|
|
346
|
+
* @param {number} height - TBD.
|
|
347
|
+
* @param resize
|
|
348
|
+
*/
|
|
300
349
|
updateDimensions(width, height, resize) {
|
|
301
350
|
this.width = width * this.parentScaleFactor.x;
|
|
302
351
|
this.height = height * this.parentScaleFactor.y;
|
|
@@ -310,6 +359,9 @@ export class ScaleManager {
|
|
|
310
359
|
}
|
|
311
360
|
}
|
|
312
361
|
|
|
362
|
+
/**
|
|
363
|
+
* TBD.
|
|
364
|
+
*/
|
|
313
365
|
updateScalingAndBounds() {
|
|
314
366
|
this.scaleFactor.x = this.game.width / this.width;
|
|
315
367
|
this.scaleFactor.y = this.game.height / this.height;
|
|
@@ -327,12 +379,21 @@ export class ScaleManager {
|
|
|
327
379
|
}
|
|
328
380
|
}
|
|
329
381
|
|
|
382
|
+
/**
|
|
383
|
+
* TBD.
|
|
384
|
+
* @param forceLandscape
|
|
385
|
+
* @param forcePortrait
|
|
386
|
+
*/
|
|
330
387
|
forceOrientation(forceLandscape = false, forcePortrait = false) {
|
|
331
388
|
this.forceLandscape = forceLandscape;
|
|
332
389
|
this.forcePortrait = forcePortrait;
|
|
333
390
|
this.queueUpdate(true);
|
|
334
391
|
}
|
|
335
392
|
|
|
393
|
+
/**
|
|
394
|
+
* TBD.
|
|
395
|
+
* @param orientation
|
|
396
|
+
*/
|
|
336
397
|
classifyOrientation(orientation) {
|
|
337
398
|
if (orientation === 'portrait-primary' || orientation === 'portrait-secondary') {
|
|
338
399
|
return 'portrait';
|
|
@@ -342,12 +403,14 @@ export class ScaleManager {
|
|
|
342
403
|
return null;
|
|
343
404
|
}
|
|
344
405
|
|
|
406
|
+
/**
|
|
407
|
+
* TBD.
|
|
408
|
+
*/
|
|
345
409
|
updateOrientationState() {
|
|
346
410
|
const previousOrientation = this.screenOrientation;
|
|
347
411
|
const previouslyIncorrect = this.incorrectOrientation;
|
|
348
412
|
this.screenOrientation = this.dom.getScreenOrientation(this.compatibility.orientationFallback);
|
|
349
|
-
this.incorrectOrientation =
|
|
350
|
-
(this.forceLandscape && !this.isLandscape) || (this.forcePortrait && !this.isPortrait);
|
|
413
|
+
this.incorrectOrientation = (this.forceLandscape && !this.isLandscape) || (this.forcePortrait && !this.isPortrait);
|
|
351
414
|
const changed = previousOrientation !== this.screenOrientation;
|
|
352
415
|
const correctnessChanged = previouslyIncorrect !== this.incorrectOrientation;
|
|
353
416
|
if (correctnessChanged) {
|
|
@@ -363,20 +426,34 @@ export class ScaleManager {
|
|
|
363
426
|
return changed || correctnessChanged;
|
|
364
427
|
}
|
|
365
428
|
|
|
429
|
+
/**
|
|
430
|
+
* TBD.
|
|
431
|
+
* @param event
|
|
432
|
+
*/
|
|
366
433
|
orientationChange(event) {
|
|
367
434
|
this.event = event;
|
|
368
435
|
this.queueUpdate(true);
|
|
369
436
|
}
|
|
370
437
|
|
|
438
|
+
/**
|
|
439
|
+
* TBD.
|
|
440
|
+
* @param event
|
|
441
|
+
*/
|
|
371
442
|
windowResize(event) {
|
|
372
443
|
this.event = event;
|
|
373
444
|
this.queueUpdate(true);
|
|
374
445
|
}
|
|
375
446
|
|
|
447
|
+
/**
|
|
448
|
+
* TBD.
|
|
449
|
+
*/
|
|
376
450
|
refresh() {
|
|
377
451
|
this.queueUpdate(true);
|
|
378
452
|
}
|
|
379
453
|
|
|
454
|
+
/**
|
|
455
|
+
* TBD.
|
|
456
|
+
*/
|
|
380
457
|
updateLayout() {
|
|
381
458
|
const scaleMode = this.currentScaleMode;
|
|
382
459
|
if (scaleMode === SCALE_RESIZE) {
|
|
@@ -405,10 +482,7 @@ export class ScaleManager {
|
|
|
405
482
|
this.width = this.game.width * this._userScaleFactor.x - this._userScaleTrim.x;
|
|
406
483
|
this.height = this.game.height * this._userScaleFactor.y - this._userScaleTrim.y;
|
|
407
484
|
}
|
|
408
|
-
if (
|
|
409
|
-
!this.compatibility.canExpandParent &&
|
|
410
|
-
(scaleMode === SCALE_SHOW_ALL || scaleMode === SCALE_USER)
|
|
411
|
-
) {
|
|
485
|
+
if (!this.compatibility.canExpandParent && (scaleMode === SCALE_SHOW_ALL || scaleMode === SCALE_USER)) {
|
|
412
486
|
const bounds = this.getParentBounds(this._tempBounds);
|
|
413
487
|
this.width = Math.min(this.width, bounds.width);
|
|
414
488
|
this.height = Math.min(this.height, bounds.height);
|
|
@@ -419,6 +493,10 @@ export class ScaleManager {
|
|
|
419
493
|
this.reflowCanvas();
|
|
420
494
|
}
|
|
421
495
|
|
|
496
|
+
/**
|
|
497
|
+
* TBD.
|
|
498
|
+
* @param target - TBD.
|
|
499
|
+
*/
|
|
422
500
|
getParentBounds(target) {
|
|
423
501
|
const bounds = target || new Rectangle();
|
|
424
502
|
const parentNode = this.boundingParent;
|
|
@@ -448,15 +526,15 @@ export class ScaleManager {
|
|
|
448
526
|
bounds.bottom = Math.min(bounds.bottom, windowBounds.height);
|
|
449
527
|
}
|
|
450
528
|
}
|
|
451
|
-
bounds.setTo(
|
|
452
|
-
Math.round(bounds.x),
|
|
453
|
-
Math.round(bounds.y),
|
|
454
|
-
Math.round(bounds.width),
|
|
455
|
-
Math.round(bounds.height)
|
|
456
|
-
);
|
|
529
|
+
bounds.setTo(Math.round(bounds.x), Math.round(bounds.y), Math.round(bounds.width), Math.round(bounds.height));
|
|
457
530
|
return bounds;
|
|
458
531
|
}
|
|
459
532
|
|
|
533
|
+
/**
|
|
534
|
+
* TBD.
|
|
535
|
+
* @param horizontal
|
|
536
|
+
* @param vertical
|
|
537
|
+
*/
|
|
460
538
|
alignCanvas(horizontal, vertical) {
|
|
461
539
|
const parentBounds = this.getParentBounds(this._tempBounds);
|
|
462
540
|
const canvas = this.game.canvas;
|
|
@@ -500,19 +578,22 @@ export class ScaleManager {
|
|
|
500
578
|
margin.y = margin.top;
|
|
501
579
|
}
|
|
502
580
|
|
|
581
|
+
/**
|
|
582
|
+
* TBD.
|
|
583
|
+
*/
|
|
503
584
|
reflowGame() {
|
|
504
585
|
this.resetCanvas('', '');
|
|
505
586
|
const bounds = this.getParentBounds(this._tempBounds);
|
|
506
587
|
this.updateDimensions(bounds.width, bounds.height, true);
|
|
507
588
|
}
|
|
508
589
|
|
|
590
|
+
/**
|
|
591
|
+
* TBD.
|
|
592
|
+
*/
|
|
509
593
|
reflowCanvas() {
|
|
510
594
|
if (!this.incorrectOrientation) {
|
|
511
595
|
this.width = Math.max(this.minWidth || 0, Math.min(this.maxWidth || this.width, this.width));
|
|
512
|
-
this.height = Math.max(
|
|
513
|
-
this.minHeight || 0,
|
|
514
|
-
Math.min(this.maxHeight || this.height, this.height)
|
|
515
|
-
);
|
|
596
|
+
this.height = Math.max(this.minHeight || 0, Math.min(this.maxHeight || this.height, this.height));
|
|
516
597
|
}
|
|
517
598
|
this.resetCanvas();
|
|
518
599
|
if (!this.compatibility.noMargins) {
|
|
@@ -525,6 +606,11 @@ export class ScaleManager {
|
|
|
525
606
|
this.updateScalingAndBounds();
|
|
526
607
|
}
|
|
527
608
|
|
|
609
|
+
/**
|
|
610
|
+
* TBD.
|
|
611
|
+
* @param cssWidth
|
|
612
|
+
* @param cssHeight
|
|
613
|
+
*/
|
|
528
614
|
resetCanvas(cssWidth = this.width + 'px', cssHeight = this.height + 'px') {
|
|
529
615
|
const canvas = this.game.canvas;
|
|
530
616
|
if (!this.compatibility.noMargins) {
|
|
@@ -537,6 +623,10 @@ export class ScaleManager {
|
|
|
537
623
|
canvas.style.height = cssHeight;
|
|
538
624
|
}
|
|
539
625
|
|
|
626
|
+
/**
|
|
627
|
+
* TBD.
|
|
628
|
+
* @param force
|
|
629
|
+
*/
|
|
540
630
|
queueUpdate(force) {
|
|
541
631
|
if (force) {
|
|
542
632
|
this._parentBounds.width = 0;
|
|
@@ -545,15 +635,25 @@ export class ScaleManager {
|
|
|
545
635
|
this._updateThrottle = this._updateThrottleReset;
|
|
546
636
|
}
|
|
547
637
|
|
|
638
|
+
/**
|
|
639
|
+
* TBD.
|
|
640
|
+
*/
|
|
548
641
|
reset() {
|
|
549
642
|
// pass
|
|
550
643
|
}
|
|
551
644
|
|
|
645
|
+
/**
|
|
646
|
+
* TBD.
|
|
647
|
+
*/
|
|
552
648
|
setMaximum() {
|
|
553
649
|
this.width = this.dom.visualBounds.width;
|
|
554
650
|
this.height = this.dom.visualBounds.height;
|
|
555
651
|
}
|
|
556
652
|
|
|
653
|
+
/**
|
|
654
|
+
* TBD.
|
|
655
|
+
* @param expanding
|
|
656
|
+
*/
|
|
557
657
|
setShowAll(expanding = false) {
|
|
558
658
|
const bounds = this.getParentBounds(this._tempBounds);
|
|
559
659
|
const width = bounds.width;
|
|
@@ -568,6 +668,9 @@ export class ScaleManager {
|
|
|
568
668
|
this.height = Math.round(this.game.height * multiplier);
|
|
569
669
|
}
|
|
570
670
|
|
|
671
|
+
/**
|
|
672
|
+
* TBD.
|
|
673
|
+
*/
|
|
571
674
|
setExactFit() {
|
|
572
675
|
const bounds = this.getParentBounds(this._tempBounds);
|
|
573
676
|
this.width = bounds.width;
|
|
@@ -584,6 +687,9 @@ export class ScaleManager {
|
|
|
584
687
|
}
|
|
585
688
|
}
|
|
586
689
|
|
|
690
|
+
/**
|
|
691
|
+
* TBD.
|
|
692
|
+
*/
|
|
587
693
|
createFullScreenTarget() {
|
|
588
694
|
const fsTarget = document.createElement('div');
|
|
589
695
|
fsTarget.style.margin = '0';
|
|
@@ -592,6 +698,11 @@ export class ScaleManager {
|
|
|
592
698
|
return fsTarget;
|
|
593
699
|
}
|
|
594
700
|
|
|
701
|
+
/**
|
|
702
|
+
* TBD.
|
|
703
|
+
* @param antialias
|
|
704
|
+
* @param allowTrampoline
|
|
705
|
+
*/
|
|
595
706
|
startFullScreen(antialias, allowTrampoline) {
|
|
596
707
|
if (this.isFullScreen) {
|
|
597
708
|
return false;
|
|
@@ -611,10 +722,7 @@ export class ScaleManager {
|
|
|
611
722
|
input.activePointer !== input.mousePointer &&
|
|
612
723
|
(allowTrampoline || allowTrampoline !== false)
|
|
613
724
|
) {
|
|
614
|
-
input.activePointer.addClickTrampoline('startFullScreen', this.startFullScreen, this, [
|
|
615
|
-
antialias,
|
|
616
|
-
false,
|
|
617
|
-
]);
|
|
725
|
+
input.activePointer.addClickTrampoline('startFullScreen', this.startFullScreen, this, [antialias, false]);
|
|
618
726
|
return false;
|
|
619
727
|
}
|
|
620
728
|
}
|
|
@@ -645,6 +753,9 @@ export class ScaleManager {
|
|
|
645
753
|
return true;
|
|
646
754
|
}
|
|
647
755
|
|
|
756
|
+
/**
|
|
757
|
+
* TBD.
|
|
758
|
+
*/
|
|
648
759
|
stopFullScreen() {
|
|
649
760
|
if (!this.isFullScreen || !this.compatibility.supportsFullScreen) {
|
|
650
761
|
return false;
|
|
@@ -654,6 +765,9 @@ export class ScaleManager {
|
|
|
654
765
|
return true;
|
|
655
766
|
}
|
|
656
767
|
|
|
768
|
+
/**
|
|
769
|
+
* TBD.
|
|
770
|
+
*/
|
|
657
771
|
cleanupCreatedTarget() {
|
|
658
772
|
const fsTarget = this._createdFullScreenTarget;
|
|
659
773
|
if (fsTarget && fsTarget.parentNode) {
|
|
@@ -666,6 +780,10 @@ export class ScaleManager {
|
|
|
666
780
|
this._createdFullScreenTarget = null;
|
|
667
781
|
}
|
|
668
782
|
|
|
783
|
+
/**
|
|
784
|
+
* TBD.
|
|
785
|
+
* @param enteringFullscreen
|
|
786
|
+
*/
|
|
669
787
|
prepScreenMode(enteringFullscreen) {
|
|
670
788
|
const fsTarget = this._createdFullScreenTarget || this.fullScreenTarget;
|
|
671
789
|
if (!fsTarget) {
|
|
@@ -696,6 +814,10 @@ export class ScaleManager {
|
|
|
696
814
|
}
|
|
697
815
|
}
|
|
698
816
|
|
|
817
|
+
/**
|
|
818
|
+
* TBD.
|
|
819
|
+
* @param event
|
|
820
|
+
*/
|
|
699
821
|
fullScreenChange(event) {
|
|
700
822
|
this.event = event;
|
|
701
823
|
if (this.isFullScreen) {
|
|
@@ -711,12 +833,19 @@ export class ScaleManager {
|
|
|
711
833
|
this.onFullScreenChange.dispatch(this, this.width, this.height);
|
|
712
834
|
}
|
|
713
835
|
|
|
836
|
+
/**
|
|
837
|
+
* TBD.
|
|
838
|
+
* @param event
|
|
839
|
+
*/
|
|
714
840
|
fullScreenError(event) {
|
|
715
841
|
this.event = event;
|
|
716
842
|
this.cleanupCreatedTarget();
|
|
717
843
|
this.onFullScreenError.dispatch(this);
|
|
718
844
|
}
|
|
719
845
|
|
|
846
|
+
/**
|
|
847
|
+
* TBD.
|
|
848
|
+
*/
|
|
720
849
|
destroy() {
|
|
721
850
|
this.game.onResume.remove(this._gameResumed, this);
|
|
722
851
|
window.removeEventListener('orientationchange', this._orientationChange, false);
|
|
@@ -734,21 +863,27 @@ export class ScaleManager {
|
|
|
734
863
|
}
|
|
735
864
|
}
|
|
736
865
|
|
|
866
|
+
/**
|
|
867
|
+
* TBD.
|
|
868
|
+
*/
|
|
737
869
|
get boundingParent() {
|
|
738
|
-
if (
|
|
739
|
-
this.parentIsWindow ||
|
|
740
|
-
(this.isFullScreen && this.hasPhaserSetFullScreen && !this._createdFullScreenTarget)
|
|
741
|
-
) {
|
|
870
|
+
if (this.parentIsWindow || (this.isFullScreen && this.hasPhaserSetFullScreen && !this._createdFullScreenTarget)) {
|
|
742
871
|
return null;
|
|
743
872
|
}
|
|
744
873
|
const parentNode = this.game.canvas && this.game.canvas.parentNode;
|
|
745
874
|
return parentNode || null;
|
|
746
875
|
}
|
|
747
876
|
|
|
877
|
+
/**
|
|
878
|
+
* TBD.
|
|
879
|
+
*/
|
|
748
880
|
get scaleMode() {
|
|
749
881
|
return this._scaleMode;
|
|
750
882
|
}
|
|
751
883
|
|
|
884
|
+
/**
|
|
885
|
+
* TBD.
|
|
886
|
+
*/
|
|
752
887
|
set scaleMode(value) {
|
|
753
888
|
if (value !== this._scaleMode) {
|
|
754
889
|
if (!this.isFullScreen) {
|
|
@@ -760,10 +895,16 @@ export class ScaleManager {
|
|
|
760
895
|
// return this._scaleMode;
|
|
761
896
|
}
|
|
762
897
|
|
|
898
|
+
/**
|
|
899
|
+
* TBD.
|
|
900
|
+
*/
|
|
763
901
|
get fullScreenScaleMode() {
|
|
764
902
|
return this._fullScreenScaleMode;
|
|
765
903
|
}
|
|
766
904
|
|
|
905
|
+
/**
|
|
906
|
+
* TBD.
|
|
907
|
+
*/
|
|
767
908
|
set fullScreenScaleMode(value) {
|
|
768
909
|
if (value !== this._fullScreenScaleMode) {
|
|
769
910
|
// If in fullscreen then need a wee bit more work
|
|
@@ -779,18 +920,30 @@ export class ScaleManager {
|
|
|
779
920
|
// return this._fullScreenScaleMode;
|
|
780
921
|
}
|
|
781
922
|
|
|
923
|
+
/**
|
|
924
|
+
* TBD.
|
|
925
|
+
*/
|
|
782
926
|
get currentScaleMode() {
|
|
783
927
|
return this.isFullScreen ? this._fullScreenScaleMode : this._scaleMode;
|
|
784
928
|
}
|
|
785
929
|
|
|
930
|
+
/**
|
|
931
|
+
* TBD.
|
|
932
|
+
*/
|
|
786
933
|
get pageAlignHorizontally() {
|
|
787
934
|
return this._pageAlignHorizontally;
|
|
788
935
|
}
|
|
789
936
|
|
|
937
|
+
/**
|
|
938
|
+
* TBD.
|
|
939
|
+
*/
|
|
790
940
|
get pageAlignVertically() {
|
|
791
941
|
return this._pageAlignVertically;
|
|
792
942
|
}
|
|
793
943
|
|
|
944
|
+
/**
|
|
945
|
+
* TBD.
|
|
946
|
+
*/
|
|
794
947
|
get isFullScreen() {
|
|
795
948
|
return !!(
|
|
796
949
|
document.fullscreenElement ||
|
|
@@ -800,18 +953,30 @@ export class ScaleManager {
|
|
|
800
953
|
);
|
|
801
954
|
}
|
|
802
955
|
|
|
956
|
+
/**
|
|
957
|
+
* TBD.
|
|
958
|
+
*/
|
|
803
959
|
get isPortrait() {
|
|
804
960
|
return this.classifyOrientation(this.screenOrientation) === 'portrait';
|
|
805
961
|
}
|
|
806
962
|
|
|
963
|
+
/**
|
|
964
|
+
* TBD.
|
|
965
|
+
*/
|
|
807
966
|
get isLandscape() {
|
|
808
967
|
return this.classifyOrientation(this.screenOrientation) === 'landscape';
|
|
809
968
|
}
|
|
810
969
|
|
|
970
|
+
/**
|
|
971
|
+
* TBD.
|
|
972
|
+
*/
|
|
811
973
|
get isGamePortrait() {
|
|
812
974
|
return this.height > this.width;
|
|
813
975
|
}
|
|
814
976
|
|
|
977
|
+
/**
|
|
978
|
+
* TBD.
|
|
979
|
+
*/
|
|
815
980
|
get isGameLandscape() {
|
|
816
981
|
return this.width > this.height;
|
|
817
982
|
}
|
package/src/phaser/core/scene.js
CHANGED
|
@@ -1,38 +1,57 @@
|
|
|
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
|
export class Scene {
|
|
2
|
+
/**
|
|
3
|
+
* TBD.
|
|
4
|
+
*/
|
|
7
5
|
constructor() {
|
|
8
6
|
this.game = null;
|
|
9
7
|
this.key = '';
|
|
10
8
|
}
|
|
11
9
|
|
|
10
|
+
/**
|
|
11
|
+
* TBD.
|
|
12
|
+
*/
|
|
12
13
|
init() {
|
|
13
14
|
// inherit
|
|
14
15
|
}
|
|
15
16
|
|
|
17
|
+
/**
|
|
18
|
+
* TBD.
|
|
19
|
+
*/
|
|
16
20
|
preload() {
|
|
17
21
|
// inherit
|
|
18
22
|
}
|
|
19
23
|
|
|
24
|
+
/**
|
|
25
|
+
* TBD.
|
|
26
|
+
*/
|
|
20
27
|
create() {
|
|
21
28
|
// inherit
|
|
22
29
|
}
|
|
23
30
|
|
|
31
|
+
/**
|
|
32
|
+
* TBD.
|
|
33
|
+
*/
|
|
24
34
|
update() {
|
|
25
35
|
// inherit
|
|
26
36
|
}
|
|
27
37
|
|
|
38
|
+
/**
|
|
39
|
+
* TBD.
|
|
40
|
+
*/
|
|
28
41
|
resize() {
|
|
29
42
|
// inherit
|
|
30
43
|
}
|
|
31
44
|
|
|
45
|
+
/**
|
|
46
|
+
* TBD.
|
|
47
|
+
*/
|
|
32
48
|
pauseUpdate() {
|
|
33
49
|
// inherit
|
|
34
50
|
}
|
|
35
51
|
|
|
52
|
+
/**
|
|
53
|
+
* TBD.
|
|
54
|
+
*/
|
|
36
55
|
shutdown() {
|
|
37
56
|
// inherit
|
|
38
57
|
}
|