@vpmedia/phaser 1.30.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 +11 -11
- 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
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GROUP } from './const.js';
|
|
2
|
+
import { Tween } from './tween.js';
|
|
2
3
|
import {
|
|
4
|
+
BackIn,
|
|
5
|
+
BackInOut,
|
|
6
|
+
BackOut,
|
|
7
|
+
BounceIn,
|
|
8
|
+
BounceInOut,
|
|
9
|
+
BounceOut,
|
|
10
|
+
CircularIn,
|
|
11
|
+
CircularInOut,
|
|
12
|
+
CircularOut,
|
|
13
|
+
CubicIn,
|
|
14
|
+
CubicInOut,
|
|
15
|
+
CubicOut,
|
|
16
|
+
ElasticIn,
|
|
17
|
+
ElasticInOut,
|
|
18
|
+
ElasticOut,
|
|
19
|
+
ExponentialIn,
|
|
20
|
+
ExponentialInOut,
|
|
21
|
+
ExponentialOut,
|
|
3
22
|
LinearNone,
|
|
4
23
|
QuadraticIn,
|
|
5
|
-
QuadraticOut,
|
|
6
24
|
QuadraticInOut,
|
|
7
|
-
|
|
8
|
-
CubicOut,
|
|
9
|
-
CubicInOut,
|
|
25
|
+
QuadraticOut,
|
|
10
26
|
QuarticIn,
|
|
11
|
-
QuarticOut,
|
|
12
27
|
QuarticInOut,
|
|
28
|
+
QuarticOut,
|
|
13
29
|
QuinticIn,
|
|
14
|
-
QuinticOut,
|
|
15
30
|
QuinticInOut,
|
|
31
|
+
QuinticOut,
|
|
16
32
|
SinusoidalIn,
|
|
17
|
-
SinusoidalOut,
|
|
18
33
|
SinusoidalInOut,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
ExponentialInOut,
|
|
22
|
-
CircularIn,
|
|
23
|
-
CircularOut,
|
|
24
|
-
CircularInOut,
|
|
25
|
-
ElasticIn,
|
|
26
|
-
ElasticOut,
|
|
27
|
-
ElasticInOut,
|
|
28
|
-
BackIn,
|
|
29
|
-
BackOut,
|
|
30
|
-
BackInOut,
|
|
31
|
-
BounceIn,
|
|
32
|
-
BounceOut,
|
|
33
|
-
BounceInOut,
|
|
34
|
-
} from './tween_easing';
|
|
35
|
-
import { GROUP } from './const';
|
|
34
|
+
SinusoidalOut,
|
|
35
|
+
} from './tween_easing.js';
|
|
36
36
|
|
|
37
37
|
export class TweenManager {
|
|
38
38
|
/**
|
|
39
39
|
* TBD.
|
|
40
|
-
* @param {import('./game').Game} game - TBD.
|
|
40
|
+
* @param {import('./game.js').Game} game - TBD.
|
|
41
41
|
*/
|
|
42
42
|
constructor(game) {
|
|
43
43
|
this.game = game;
|
package/src/phaser/core/world.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Group } from '../display/group';
|
|
1
|
+
import { Group } from '../display/group.js';
|
|
2
2
|
|
|
3
3
|
export class World extends Group {
|
|
4
4
|
/**
|
|
5
5
|
* TBD.
|
|
6
|
-
* @param {import('./game').Game} game - TBD.
|
|
6
|
+
* @param {import('./game.js').Game} game - TBD.
|
|
7
7
|
*/
|
|
8
8
|
constructor(game) {
|
|
9
9
|
super(game, null, '__world', false);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { BITMAP_TEXT, SCALE_LINEAR, SCALE_NEAREST } from '../core/const.js';
|
|
2
|
+
import { Point } from '../geom/point.js';
|
|
3
|
+
import { DisplayObject } from './display_object.js';
|
|
4
|
+
import { Image } from './image.js';
|
|
5
5
|
|
|
6
6
|
export class BitmapText extends DisplayObject {
|
|
7
7
|
/**
|
|
8
8
|
* TBD.
|
|
9
|
-
* @param {import('../core/game').Game} game - TBD.
|
|
9
|
+
* @param {import('../core/game.js').Game} game - TBD.
|
|
10
10
|
* @param {number} x - TBD.
|
|
11
11
|
* @param {number} y - TBD.
|
|
12
12
|
* @param {string} font - TBD.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { BUTTON, POINTER_CONTACT } from '../core/const.js';
|
|
2
|
+
import { InputHandler } from '../core/input_handler.js';
|
|
3
|
+
import { Signal } from '../core/signal.js';
|
|
4
|
+
import { Image } from './image.js';
|
|
5
5
|
|
|
6
6
|
const STATE_OVER = 'Over';
|
|
7
7
|
const STATE_OUT = 'Out';
|
|
@@ -12,7 +12,7 @@ const STATE_DISABLED = 'Disabled';
|
|
|
12
12
|
export class Button extends Image {
|
|
13
13
|
/**
|
|
14
14
|
* TBD.
|
|
15
|
-
* @param {import('../core/game').Game} game - TBD.
|
|
15
|
+
* @param {import('../core/game.js').Game} game - TBD.
|
|
16
16
|
* @param {number} x - TBD.
|
|
17
17
|
* @param {number} y - TBD.
|
|
18
18
|
* @param {string} key - TBD.
|
|
@@ -33,7 +33,7 @@ export class Button extends Image {
|
|
|
33
33
|
overFrame = null,
|
|
34
34
|
outFrame = null,
|
|
35
35
|
downFrame = null,
|
|
36
|
-
upFrame = null
|
|
36
|
+
upFrame = null,
|
|
37
37
|
) {
|
|
38
38
|
super(game, x, y, key, outFrame);
|
|
39
39
|
this.type = BUTTON;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { renderGraphicsMask } from './graphics';
|
|
1
|
+
import { renderGraphicsMask } from './graphics.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* TBD.
|
|
@@ -17,7 +17,7 @@ export function pushMask(maskData, renderSession) {
|
|
|
17
17
|
transform.c * resolution,
|
|
18
18
|
transform.d * resolution,
|
|
19
19
|
transform.tx * resolution,
|
|
20
|
-
transform.ty * resolution
|
|
20
|
+
transform.ty * resolution,
|
|
21
21
|
);
|
|
22
22
|
renderGraphicsMask(maskData, context);
|
|
23
23
|
context.clip();
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
|
-
RENDER_CANVAS,
|
|
3
|
-
SCALE_LINEAR,
|
|
4
|
-
BLEND_NORMAL,
|
|
5
2
|
BLEND_ADD,
|
|
6
|
-
|
|
7
|
-
BLEND_SCREEN,
|
|
8
|
-
BLEND_OVERLAY,
|
|
9
|
-
BLEND_DARKEN,
|
|
10
|
-
BLEND_LIGHTEN,
|
|
11
|
-
BLEND_COLOR_DODGE,
|
|
3
|
+
BLEND_COLOR,
|
|
12
4
|
BLEND_COLOR_BURN,
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
BLEND_COLOR_DODGE,
|
|
6
|
+
BLEND_DARKEN,
|
|
15
7
|
BLEND_DIFFERENCE,
|
|
16
8
|
BLEND_EXCLUSION,
|
|
9
|
+
BLEND_HARD_LIGHT,
|
|
17
10
|
BLEND_HUE,
|
|
18
|
-
|
|
19
|
-
BLEND_COLOR,
|
|
11
|
+
BLEND_LIGHTEN,
|
|
20
12
|
BLEND_LUMINOSITY,
|
|
13
|
+
BLEND_MULTIPLY,
|
|
14
|
+
BLEND_NORMAL,
|
|
15
|
+
BLEND_OVERLAY,
|
|
16
|
+
BLEND_SATURATION,
|
|
17
|
+
BLEND_SCREEN,
|
|
18
|
+
BLEND_SOFT_LIGHT,
|
|
19
|
+
RENDER_CANVAS,
|
|
20
|
+
SCALE_LINEAR,
|
|
21
21
|
SCALE_NEAREST,
|
|
22
|
-
} from '../../core/const';
|
|
23
|
-
import
|
|
24
|
-
import { detectCapabilities } from './tinter';
|
|
25
|
-
import
|
|
22
|
+
} from '../../core/const.js';
|
|
23
|
+
import * as CanvasMaskManager from './masker.js';
|
|
24
|
+
import { detectCapabilities } from './tinter.js';
|
|
25
|
+
import { getSmoothingPrefix } from './util.js';
|
|
26
26
|
|
|
27
27
|
export class CanvasRenderer {
|
|
28
28
|
/**
|
|
29
29
|
* TBD.
|
|
30
|
-
* @param {import('../../core/game').Game} game - TBD.
|
|
30
|
+
* @param {import('../../core/game.js').Game} game - TBD.
|
|
31
31
|
*/
|
|
32
32
|
constructor(game) {
|
|
33
33
|
detectCapabilities();
|
|
@@ -59,7 +59,7 @@ export class CanvasRenderer {
|
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* TBD.
|
|
62
|
-
* @param {import('../../core/stage').Stage} root - TBD.
|
|
62
|
+
* @param {import('../../core/stage.js').Stage} root - TBD.
|
|
63
63
|
*/
|
|
64
64
|
render(root) {
|
|
65
65
|
if (!this.context) {
|
|
@@ -116,9 +116,9 @@ export class CanvasRenderer {
|
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
118
|
* TBD.
|
|
119
|
-
* @param {import('../../display/image').Image} displayObject - TBD.
|
|
119
|
+
* @param {import('../../display/image.js').Image} displayObject - TBD.
|
|
120
120
|
* @param {CanvasRenderingContext2D} context - TBD.
|
|
121
|
-
* @param {import('../../geom/matrix').Matrix} matrix - TBD.
|
|
121
|
+
* @param {import('../../geom/matrix.js').Matrix} matrix - TBD.
|
|
122
122
|
*/
|
|
123
123
|
renderDisplayObject(displayObject, context, matrix) {
|
|
124
124
|
this.renderSession.context = context || this.context;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CanvasBuffer } from './buffer';
|
|
2
|
-
import { create, removeByCanvas } from './pool';
|
|
3
|
-
import { hex2rgb } from '../../util/math';
|
|
1
|
+
import { CanvasBuffer } from './buffer.js';
|
|
2
|
+
import { create, removeByCanvas } from './pool.js';
|
|
3
|
+
import { hex2rgb } from '../../util/math.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* TBD.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { getIdentityMatrix } from '../geom/util/matrix';
|
|
5
|
-
import { PI_2 } from '../util/math';
|
|
6
|
-
import { renderCanvas, renderWebGL } from './sprite_util';
|
|
1
|
+
import { Matrix } from '../geom/matrix.js';
|
|
2
|
+
import { Point } from '../geom/point.js';
|
|
3
|
+
import { Rectangle } from '../geom/rectangle.js';
|
|
4
|
+
import { getIdentityMatrix } from '../geom/util/matrix.js';
|
|
5
|
+
import { PI_2 } from '../util/math.js';
|
|
6
|
+
import { renderCanvas, renderWebGL } from './sprite_util.js';
|
|
7
7
|
|
|
8
8
|
export class DisplayObject {
|
|
9
9
|
/**
|
|
@@ -157,7 +157,7 @@ export class DisplayObject {
|
|
|
157
157
|
throw new Error(
|
|
158
158
|
'getChildAt: Supplied index ' +
|
|
159
159
|
index +
|
|
160
|
-
' does not exist in the child list, or the supplied DisplayObject must be a child of the caller'
|
|
160
|
+
' does not exist in the child list, or the supplied DisplayObject must be a child of the caller',
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
return this.children[index];
|
|
@@ -292,7 +292,7 @@ export class DisplayObject {
|
|
|
292
292
|
// this.worldPosition.set(wt.tx, wt.ty);
|
|
293
293
|
this.worldScale.set(
|
|
294
294
|
this.scale.x * Math.sqrt(wt.a * wt.a + wt.c * wt.c),
|
|
295
|
-
this.scale.y * Math.sqrt(wt.b * wt.b + wt.d * wt.d)
|
|
295
|
+
this.scale.y * Math.sqrt(wt.b * wt.b + wt.d * wt.d),
|
|
296
296
|
);
|
|
297
297
|
this.worldRotation = Math.atan2(-wt.c, wt.d);
|
|
298
298
|
// reset the bounds each time this is called!
|
|
@@ -671,7 +671,7 @@ export class DisplayObject {
|
|
|
671
671
|
|
|
672
672
|
/**
|
|
673
673
|
* TBD.
|
|
674
|
-
* @returns {import('./graphics').Graphics} TBD.
|
|
674
|
+
* @returns {import('./graphics.js').Graphics} TBD.
|
|
675
675
|
*/
|
|
676
676
|
get mask() {
|
|
677
677
|
return this._mask;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { DisplayObject } from './display_object';
|
|
2
|
-
import { Image } from './image';
|
|
3
|
-
import { Rectangle } from '../geom/rectangle';
|
|
4
|
-
import { RoundedRectangle } from '../geom/rounded_rectangle';
|
|
5
|
-
import { Polygon } from '../geom/polygon';
|
|
6
|
-
import { Circle } from '../geom/circle';
|
|
7
|
-
import { Ellipse } from '../geom/ellipse';
|
|
8
|
-
import { Point } from '../geom/point';
|
|
9
|
-
import { GraphicsData } from './graphics_data';
|
|
10
|
-
import { CanvasBuffer } from './canvas/buffer';
|
|
11
|
-
import { textureFromCanvas } from './webgl/texture_util';
|
|
12
|
-
import { renderGraphics as renderCanvasGraphics } from './canvas/graphics';
|
|
13
|
-
import { renderGraphics as renderWebGLGraphics } from './webgl/graphics';
|
|
14
|
-
import { renderCanvas as renderSpriteCanvas, renderWebGL as renderSpriteWebGL } from './sprite_util';
|
|
15
|
-
import { getEmptyRectangle } from '../geom/util/rectangle';
|
|
16
|
-
import { getIdentityMatrix } from '../geom/util/matrix';
|
|
17
1
|
import {
|
|
18
2
|
BLEND_NORMAL,
|
|
19
|
-
GRAPHICS,
|
|
20
|
-
GEOM_POLYGON,
|
|
21
3
|
GEOM_CIRCLE,
|
|
22
4
|
GEOM_ELLIPSE,
|
|
5
|
+
GEOM_POLYGON,
|
|
23
6
|
GEOM_RECTANGLE,
|
|
24
7
|
GEOM_ROUNDED_RECTANGLE,
|
|
25
|
-
|
|
8
|
+
GRAPHICS,
|
|
9
|
+
} from '../core/const.js';
|
|
10
|
+
import { Circle } from '../geom/circle.js';
|
|
11
|
+
import { Ellipse } from '../geom/ellipse.js';
|
|
12
|
+
import { Point } from '../geom/point.js';
|
|
13
|
+
import { Polygon } from '../geom/polygon.js';
|
|
14
|
+
import { Rectangle } from '../geom/rectangle.js';
|
|
15
|
+
import { RoundedRectangle } from '../geom/rounded_rectangle.js';
|
|
16
|
+
import { getIdentityMatrix } from '../geom/util/matrix.js';
|
|
17
|
+
import { getEmptyRectangle } from '../geom/util/rectangle.js';
|
|
18
|
+
import { CanvasBuffer } from './canvas/buffer.js';
|
|
19
|
+
import { renderGraphics as renderCanvasGraphics } from './canvas/graphics.js';
|
|
20
|
+
import { DisplayObject } from './display_object.js';
|
|
21
|
+
import { GraphicsData } from './graphics_data.js';
|
|
22
|
+
import { Image } from './image.js';
|
|
23
|
+
import { renderCanvas as renderSpriteCanvas, renderWebGL as renderSpriteWebGL } from './sprite_util.js';
|
|
24
|
+
import { renderGraphics as renderWebGLGraphics } from './webgl/graphics.js';
|
|
25
|
+
import { textureFromCanvas } from './webgl/texture_util.js';
|
|
26
26
|
|
|
27
27
|
export class Graphics extends DisplayObject {
|
|
28
28
|
/**
|
|
29
29
|
* TBD.
|
|
30
|
-
* @param {import('../core/game').Game} game - TBD.
|
|
30
|
+
* @param {import('../core/game.js').Game} game - TBD.
|
|
31
31
|
* @param {number} x - TBD.
|
|
32
32
|
* @param {number} y - TBD.
|
|
33
33
|
*/
|
|
@@ -190,7 +190,7 @@ export class Graphics extends DisplayObject {
|
|
|
190
190
|
t3 = t2 * j;
|
|
191
191
|
points.push(
|
|
192
192
|
dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX,
|
|
193
|
-
dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY
|
|
193
|
+
dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY,
|
|
194
194
|
);
|
|
195
195
|
}
|
|
196
196
|
this.dirty = true;
|
|
@@ -538,7 +538,7 @@ export class Graphics extends DisplayObject {
|
|
|
538
538
|
transform.c * resolution,
|
|
539
539
|
transform.d * resolution,
|
|
540
540
|
tx,
|
|
541
|
-
ty
|
|
541
|
+
ty,
|
|
542
542
|
);
|
|
543
543
|
renderCanvasGraphics(this, context);
|
|
544
544
|
// simple render children!
|
|
@@ -553,7 +553,7 @@ export class Graphics extends DisplayObject {
|
|
|
553
553
|
|
|
554
554
|
/**
|
|
555
555
|
* TBD.
|
|
556
|
-
* @param {import('../geom/matrix').Matrix} matrix - TBD.
|
|
556
|
+
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
|
|
557
557
|
* @returns {Rectangle} TBD.
|
|
558
558
|
*/
|
|
559
559
|
getBounds(matrix = null) {
|
|
@@ -812,7 +812,7 @@ export class Graphics extends DisplayObject {
|
|
|
812
812
|
this.fillColor,
|
|
813
813
|
this.fillAlpha,
|
|
814
814
|
this.filling,
|
|
815
|
-
shape
|
|
815
|
+
shape,
|
|
816
816
|
);
|
|
817
817
|
this.graphicsData.push(data);
|
|
818
818
|
if (data.type === GEOM_POLYGON) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GraphicsData } from './graphics_data';
|
|
1
|
+
import { GraphicsData } from './graphics_data.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* TBD.
|
|
@@ -13,6 +13,6 @@ export function clone(source) {
|
|
|
13
13
|
source.fillColor,
|
|
14
14
|
source.fillAlpha,
|
|
15
15
|
source.fill,
|
|
16
|
-
source.shape
|
|
16
|
+
source.shape,
|
|
17
17
|
);
|
|
18
18
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { GROUP } from '../core/const.js';
|
|
2
|
+
import { Signal } from '../core/signal.js';
|
|
3
|
+
import { DisplayObject } from './display_object.js';
|
|
4
|
+
import { Image } from './image.js';
|
|
5
5
|
|
|
6
6
|
export const SORT_ASCENDING = -1;
|
|
7
7
|
export const SORT_DESCENDING = 1;
|
|
@@ -9,7 +9,7 @@ export const SORT_DESCENDING = 1;
|
|
|
9
9
|
export class Group extends DisplayObject {
|
|
10
10
|
/**
|
|
11
11
|
* TBD.
|
|
12
|
-
* @param {import('../core/game').Game} game - TBD.
|
|
12
|
+
* @param {import('../core/game.js').Game} game - TBD.
|
|
13
13
|
* @param {DisplayObject} parent - TBD.
|
|
14
14
|
* @param {string} name - TBD.
|
|
15
15
|
* @param {boolean} addToStage - TBD.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { EventManager } from '../core/event_manager';
|
|
4
|
-
import { Rectangle } from '../geom/rectangle';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { AnimationManager } from '../core/animation_manager.js';
|
|
2
|
+
import { BLEND_NORMAL, IMAGE, PENDING_ATLAS, SCALE_NEAREST } from '../core/const.js';
|
|
3
|
+
import { EventManager } from '../core/event_manager.js';
|
|
4
|
+
import { Rectangle } from '../geom/rectangle.js';
|
|
5
|
+
import { clone } from '../geom/util/rectangle.js';
|
|
6
|
+
import { DisplayObject } from './display_object.js';
|
|
7
|
+
import { getBounds, getLocalBounds, renderCanvas, renderWebGL, setTexture } from './sprite_util.js';
|
|
8
|
+
import { Texture } from './webgl/texture.js';
|
|
9
9
|
|
|
10
10
|
export class Image extends DisplayObject {
|
|
11
11
|
/**
|
|
12
12
|
* TBD.
|
|
13
|
-
* @param {import('../core/game').Game} game - TBD.
|
|
13
|
+
* @param {import('../core/game.js').Game} game - TBD.
|
|
14
14
|
* @param {number} x - TBD.
|
|
15
15
|
* @param {number} y - TBD.
|
|
16
16
|
* @param {string} key - TBD.
|
|
@@ -138,7 +138,7 @@ export class Image extends DisplayObject {
|
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
140
|
* TBD.
|
|
141
|
-
* @param {import('../core/frame').Frame} frame - TBD.
|
|
141
|
+
* @param {import('../core/frame.js').Frame} frame - TBD.
|
|
142
142
|
*/
|
|
143
143
|
setFrame(frame) {
|
|
144
144
|
this._frame = frame;
|
|
@@ -343,7 +343,7 @@ export class Image extends DisplayObject {
|
|
|
343
343
|
|
|
344
344
|
/**
|
|
345
345
|
* TBD.
|
|
346
|
-
* @param {import('../geom/matrix').Matrix} matrix - TBD.
|
|
346
|
+
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
|
|
347
347
|
* @returns {Rectangle} TBD.
|
|
348
348
|
*/
|
|
349
349
|
getBounds(matrix = null) {
|
|
@@ -361,7 +361,7 @@ export class Image extends DisplayObject {
|
|
|
361
361
|
/**
|
|
362
362
|
* TBD.
|
|
363
363
|
* @param {object} renderSession - TBD.
|
|
364
|
-
* @param {import('../geom/matrix').Matrix} matrix - TBD.
|
|
364
|
+
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
|
|
365
365
|
*/
|
|
366
366
|
renderWebGL(renderSession, matrix = null) {
|
|
367
367
|
renderWebGL(this, renderSession, matrix);
|
|
@@ -370,7 +370,7 @@ export class Image extends DisplayObject {
|
|
|
370
370
|
/**
|
|
371
371
|
* TBD.
|
|
372
372
|
* @param {object} renderSession - TBD.
|
|
373
|
-
* @param {import('../geom/matrix').Matrix} matrix - TBD.
|
|
373
|
+
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
|
|
374
374
|
*/
|
|
375
375
|
renderCanvas(renderSession, matrix = null) {
|
|
376
376
|
renderCanvas(this, renderSession, matrix);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DisplayObject } from './display_object';
|
|
1
|
+
import { DisplayObject } from './display_object.js';
|
|
2
2
|
|
|
3
3
|
export class SpriteBatch extends DisplayObject {
|
|
4
4
|
/**
|
|
5
5
|
* TBD.
|
|
6
|
-
* @param {import('../core/game').Game} game - TBD.
|
|
6
|
+
* @param {import('../core/game.js').Game} game - TBD.
|
|
7
7
|
*/
|
|
8
8
|
constructor(game) {
|
|
9
9
|
super();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getIdentityMatrix } from '../geom/util/matrix';
|
|
3
|
-
import {
|
|
1
|
+
import { SCALE_LINEAR } from '../core/const.js';
|
|
2
|
+
import { getIdentityMatrix } from '../geom/util/matrix.js';
|
|
3
|
+
import { getTintedTexture } from './canvas/tinter.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* TBD.
|
|
7
|
-
* @param {import('./image').Image} target - TBD.
|
|
8
|
-
* @param {import('./webgl/texture').Texture} texture - TBD.
|
|
7
|
+
* @param {import('./image.js').Image} target - TBD.
|
|
8
|
+
* @param {import('./webgl/texture.js').Texture} texture - TBD.
|
|
9
9
|
* @param {boolean} destroyBase - TBD.
|
|
10
10
|
*/
|
|
11
11
|
export function setTexture(target, texture, destroyBase = false) {
|
|
@@ -20,9 +20,9 @@ export function setTexture(target, texture, destroyBase = false) {
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* TBD.
|
|
23
|
-
* @param {import('./image').Image} target - TBD.
|
|
23
|
+
* @param {import('./image.js').Image} target - TBD.
|
|
24
24
|
* @param {object} matrix - TBD.
|
|
25
|
-
* @returns {import('../geom/rectangle').Rectangle} TBD.
|
|
25
|
+
* @returns {import('../geom/rectangle.js').Rectangle} TBD.
|
|
26
26
|
*/
|
|
27
27
|
export function getBounds(target, matrix = null) {
|
|
28
28
|
// TODO verify
|
|
@@ -103,8 +103,8 @@ export function getBounds(target, matrix = null) {
|
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* TBD.
|
|
106
|
-
* @param {import('./image').Image} target - TBD.
|
|
107
|
-
* @returns {import('../geom/rectangle').Rectangle} TBD.
|
|
106
|
+
* @param {import('./image.js').Image} target - TBD.
|
|
107
|
+
* @returns {import('../geom/rectangle.js').Rectangle} TBD.
|
|
108
108
|
*/
|
|
109
109
|
export function getLocalBounds(target) {
|
|
110
110
|
const matrixCache = target.worldTransform;
|
|
@@ -123,9 +123,9 @@ export function getLocalBounds(target) {
|
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* TBD.
|
|
126
|
-
* @param {import('./image').Image} target - TBD.
|
|
126
|
+
* @param {import('./image.js').Image} target - TBD.
|
|
127
127
|
* @param {object} renderSession - TBD.
|
|
128
|
-
* @param {import('../geom/matrix').Matrix} matrix - TBD.
|
|
128
|
+
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
|
|
129
129
|
*/
|
|
130
130
|
export function renderWebGL(target, renderSession, matrix) {
|
|
131
131
|
// if the sprite is not visible or the alpha is 0 then no need to render this element
|
|
@@ -172,9 +172,9 @@ export function renderWebGL(target, renderSession, matrix) {
|
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
174
|
* TBD.
|
|
175
|
-
* @param {import('./image').Image} target - TBD.
|
|
175
|
+
* @param {import('./image.js').Image} target - TBD.
|
|
176
176
|
* @param {object} renderSession - TBD.
|
|
177
|
-
* @param {import('../geom/matrix').Matrix} matrix - TBD.
|
|
177
|
+
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
|
|
178
178
|
*/
|
|
179
179
|
export function renderCanvas(target, renderSession, matrix) {
|
|
180
180
|
// If the sprite is not visible or the alpha is 0 then no need to render this element
|
|
@@ -253,7 +253,7 @@ export function renderCanvas(target, renderSession, matrix) {
|
|
|
253
253
|
dx,
|
|
254
254
|
dy,
|
|
255
255
|
cw / resolution,
|
|
256
|
-
ch / resolution
|
|
256
|
+
ch / resolution,
|
|
257
257
|
);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { TEXT } from '../core/const.js';
|
|
2
|
+
import { Point } from '../geom/point.js';
|
|
3
|
+
import { Rectangle } from '../geom/rectangle.js';
|
|
4
|
+
import { snapToCeil } from '../util/math.js';
|
|
5
|
+
import { create, remove } from './canvas/pool.js';
|
|
6
|
+
import { Image } from './image.js';
|
|
7
|
+
import { getBounds, renderCanvas, renderWebGL } from './sprite_util.js';
|
|
8
|
+
import { textureFromCanvas } from './webgl/texture_util.js';
|
|
9
9
|
|
|
10
10
|
export class Text extends Image {
|
|
11
11
|
/**
|
|
12
12
|
* TBD.
|
|
13
|
-
* @param {import('../core/game').Game} game - TBD.
|
|
13
|
+
* @param {import('../core/game.js').Game} game - TBD.
|
|
14
14
|
* @param {number} x - TBD.
|
|
15
15
|
* @param {number} y - TBD.
|
|
16
16
|
* @param {string} text - TBD.
|
|
@@ -668,7 +668,7 @@ export class Text extends Image {
|
|
|
668
668
|
// {number} (em | ex | ch | rem | vh | vw | vmin | vmax | px | mm | cm | in | pt | pc | %)
|
|
669
669
|
// font-family - rest (but identifiers or quoted with comma separation)
|
|
670
670
|
const m = font.match(
|
|
671
|
-
/^\s*(?:\b(normal|italic|oblique|inherit)?\b)\s*(?:\b(normal|small-caps|inherit)?\b)\s*(?:\b(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit)?\b)\s*(?:\b(xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller|0|\d*(?:[.]\d*)?(?:%|[a-z]{2,5}))?\b)\s*(.*)\s
|
|
671
|
+
/^\s*(?:\b(normal|italic|oblique|inherit)?\b)\s*(?:\b(normal|small-caps|inherit)?\b)\s*(?:\b(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit)?\b)\s*(?:\b(xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller|0|\d*(?:[.]\d*)?(?:%|[a-z]{2,5}))?\b)\s*(.*)\s*$/,
|
|
672
672
|
);
|
|
673
673
|
if (m) {
|
|
674
674
|
let family = m[5].trim();
|
|
@@ -975,7 +975,7 @@ export class Text extends Image {
|
|
|
975
975
|
|
|
976
976
|
/**
|
|
977
977
|
* TBD.
|
|
978
|
-
* @param {import('../geom/matrix').Matrix} matrix - TBD.
|
|
978
|
+
* @param {import('../geom/matrix.js').Matrix} matrix - TBD.
|
|
979
979
|
* @returns {Rectangle} TBD.
|
|
980
980
|
*/
|
|
981
981
|
getBounds(matrix = null) {
|