@vpmedia/phaser 1.12.0 → 1.14.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 +2 -2
- package/src/index.js +19 -19
- package/src/phaser/core/animation.js +3 -3
- package/src/phaser/core/animation_manager.js +3 -3
- package/src/phaser/core/animation_parser.js +16 -14
- package/src/phaser/core/array_set.js +2 -2
- package/src/phaser/core/cache.js +7 -7
- package/src/phaser/core/const.js +1 -1
- package/src/phaser/core/device.js +2 -2
- package/src/phaser/core/device_util.js +29 -11
- package/src/phaser/core/dom.js +3 -3
- package/src/phaser/core/event_manager.js +3 -3
- package/src/phaser/core/factory.js +8 -8
- package/src/phaser/core/frame.js +3 -3
- package/src/phaser/core/frame_data.js +2 -2
- package/src/phaser/core/frame_util.js +11 -9
- package/src/phaser/core/game.js +19 -18
- package/src/phaser/core/input.js +12 -12
- package/src/phaser/core/input_handler.js +3 -3
- package/src/phaser/core/input_mouse.js +2 -4
- package/src/phaser/core/input_mspointer.js +2 -2
- package/src/phaser/core/input_pointer.js +4 -4
- package/src/phaser/core/input_touch.js +2 -2
- package/src/phaser/core/loader.js +4 -4
- package/src/phaser/core/loader_parser.js +25 -21
- package/src/phaser/core/raf.js +2 -2
- package/src/phaser/core/scale_manager.js +6 -6
- package/src/phaser/core/scene.js +2 -2
- package/src/phaser/core/scene_manager.js +3 -3
- package/src/phaser/core/signal.js +4 -3
- package/src/phaser/core/signal_binding.js +2 -2
- package/src/phaser/core/sound.js +3 -3
- package/src/phaser/core/sound_manager.js +6 -6
- package/src/phaser/core/sound_sprite.js +2 -2
- package/src/phaser/core/stage.js +4 -4
- package/src/phaser/core/time.js +3 -3
- package/src/phaser/core/timer.js +4 -4
- package/src/phaser/core/timer_event.js +2 -2
- package/src/phaser/core/tween.js +4 -4
- package/src/phaser/core/tween_data.js +2 -2
- package/src/phaser/core/tween_easing.js +94 -63
- package/src/phaser/core/tween_manager.js +3 -3
- package/src/phaser/core/world.js +3 -3
- package/src/phaser/display/bitmap_text.js +17 -5
- package/src/phaser/display/button.js +20 -5
- package/src/phaser/display/canvas/buffer.js +2 -2
- package/src/phaser/display/canvas/graphics.js +9 -6
- package/src/phaser/display/canvas/masker.js +6 -4
- package/src/phaser/display/canvas/pool.js +18 -11
- package/src/phaser/display/canvas/renderer.js +2 -2
- package/src/phaser/display/canvas/tinter.js +19 -14
- package/src/phaser/display/canvas/util.js +43 -34
- package/src/phaser/display/display_object.js +9 -5
- package/src/phaser/display/graphics.js +20 -12
- package/src/phaser/display/graphics_data.js +3 -2
- package/src/phaser/display/graphics_data_util.js +6 -4
- package/src/phaser/display/group.js +14 -5
- package/src/phaser/display/image.js +17 -7
- package/src/phaser/display/sprite_batch.js +9 -3
- package/src/phaser/display/sprite_util.js +21 -15
- package/src/phaser/display/text.js +15 -5
- package/src/phaser/display/webgl/abstract_filter.js +2 -2
- package/src/phaser/display/webgl/base_texture.js +3 -2
- package/src/phaser/display/webgl/blend_manager.js +2 -2
- package/src/phaser/display/webgl/earcut.js +135 -108
- package/src/phaser/display/webgl/earcut_node.js +2 -2
- package/src/phaser/display/webgl/fast_sprite_batch.js +2 -4
- package/src/phaser/display/webgl/filter_manager.js +2 -2
- package/src/phaser/display/webgl/filter_texture.js +2 -2
- package/src/phaser/display/webgl/graphics.js +44 -34
- package/src/phaser/display/webgl/graphics_data.js +2 -2
- package/src/phaser/display/webgl/mask_manager.js +7 -5
- package/src/phaser/display/webgl/render_texture.js +8 -8
- package/src/phaser/display/webgl/renderer.js +8 -8
- 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 +2 -2
- 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 +7 -7
- package/src/phaser/display/webgl/sprite_batch.js +4 -6
- package/src/phaser/display/webgl/stencil_manager.js +2 -2
- package/src/phaser/display/webgl/texture.js +4 -3
- package/src/phaser/display/webgl/texture_util.js +11 -9
- package/src/phaser/display/webgl/util.js +20 -16
- package/src/phaser/geom/circle.js +12 -4
- package/src/phaser/geom/ellipse.js +13 -4
- package/src/phaser/geom/line.js +12 -3
- package/src/phaser/geom/matrix.js +14 -3
- package/src/phaser/geom/point.js +9 -2
- package/src/phaser/geom/polygon.js +4 -3
- package/src/phaser/geom/rectangle.js +12 -3
- package/src/phaser/geom/rounded_rectangle.js +12 -2
- package/src/phaser/geom/util/circle.js +37 -29
- package/src/phaser/geom/util/ellipse.js +7 -15
- package/src/phaser/geom/util/line.js +30 -24
- package/src/phaser/geom/util/matrix.js +11 -9
- package/src/phaser/geom/util/point.js +100 -78
- package/src/phaser/geom/util/polygon.js +7 -15
- package/src/phaser/geom/util/rectangle.js +78 -62
- package/src/phaser/geom/util/rounded_rectangle.js +7 -15
- package/src/phaser/util/math.js +86 -66
- package/types/global.d.ts +7 -0
- package/types/index.d.ts +18 -18
- package/types/index.d.ts.map +1 -1
- package/types/phaser/core/animation.d.ts +5 -5
- package/types/phaser/core/animation.d.ts.map +1 -1
- package/types/phaser/core/animation_manager.d.ts +1 -1
- package/types/phaser/core/animation_parser.d.ts +13 -11
- package/types/phaser/core/animation_parser.d.ts.map +1 -1
- package/types/phaser/core/array_set.d.ts +2 -2
- package/types/phaser/core/cache.d.ts +5 -5
- package/types/phaser/core/cache.d.ts.map +1 -1
- package/types/phaser/core/const.d.ts +1 -1
- package/types/phaser/core/device.d.ts +2 -2
- package/types/phaser/core/device_util.d.ts +31 -21
- package/types/phaser/core/device_util.d.ts.map +1 -1
- package/types/phaser/core/dom.d.ts +1 -1
- package/types/phaser/core/event_manager.d.ts +2 -2
- package/types/phaser/core/event_manager.d.ts.map +1 -1
- package/types/phaser/core/factory.d.ts +2 -2
- package/types/phaser/core/factory.d.ts.map +1 -1
- package/types/phaser/core/frame.d.ts +2 -2
- package/types/phaser/core/frame.d.ts.map +1 -1
- package/types/phaser/core/frame_data.d.ts +1 -1
- package/types/phaser/core/frame_util.d.ts +8 -6
- package/types/phaser/core/frame_util.d.ts.map +1 -1
- package/types/phaser/core/game.d.ts +17 -17
- package/types/phaser/core/game.d.ts.map +1 -1
- package/types/phaser/core/input.d.ts +9 -9
- package/types/phaser/core/input.d.ts.map +1 -1
- package/types/phaser/core/input_handler.d.ts +2 -2
- package/types/phaser/core/input_handler.d.ts.map +1 -1
- package/types/phaser/core/input_mouse.d.ts +1 -1
- package/types/phaser/core/input_mouse.d.ts.map +1 -1
- package/types/phaser/core/input_mspointer.d.ts +2 -2
- package/types/phaser/core/input_pointer.d.ts +6 -6
- package/types/phaser/core/input_pointer.d.ts.map +1 -1
- package/types/phaser/core/input_touch.d.ts +2 -2
- package/types/phaser/core/loader.d.ts +17 -17
- package/types/phaser/core/loader.d.ts.map +1 -1
- package/types/phaser/core/loader_parser.d.ts +22 -18
- package/types/phaser/core/loader_parser.d.ts.map +1 -1
- package/types/phaser/core/raf.d.ts +2 -2
- package/types/phaser/core/scale_manager.d.ts +5 -5
- package/types/phaser/core/scale_manager.d.ts.map +1 -1
- package/types/phaser/core/scene.d.ts +2 -2
- package/types/phaser/core/scene_manager.d.ts +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 +2 -2
- package/types/phaser/core/sound.d.ts +4 -4
- package/types/phaser/core/sound.d.ts.map +1 -1
- package/types/phaser/core/sound_manager.d.ts +5 -5
- package/types/phaser/core/sound_manager.d.ts.map +1 -1
- package/types/phaser/core/sound_sprite.d.ts +2 -2
- package/types/phaser/core/stage.d.ts +2 -2
- package/types/phaser/core/stage.d.ts.map +1 -1
- package/types/phaser/core/time.d.ts +2 -2
- package/types/phaser/core/time.d.ts.map +1 -1
- package/types/phaser/core/timer.d.ts +3 -3
- package/types/phaser/core/timer.d.ts.map +1 -1
- package/types/phaser/core/timer_event.d.ts +2 -2
- package/types/phaser/core/tween.d.ts +18 -18
- 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_easing.d.ts +94 -63
- package/types/phaser/core/tween_easing.d.ts.map +1 -1
- package/types/phaser/core/tween_manager.d.ts +2 -2
- package/types/phaser/core/tween_manager.d.ts.map +1 -1
- package/types/phaser/core/world.d.ts +2 -2
- package/types/phaser/core/world.d.ts.map +1 -1
- package/types/phaser/display/bitmap_text.d.ts +16 -5
- package/types/phaser/display/bitmap_text.d.ts.map +1 -1
- package/types/phaser/display/button.d.ts +19 -5
- package/types/phaser/display/button.d.ts.map +1 -1
- package/types/phaser/display/canvas/buffer.d.ts +1 -1
- package/types/phaser/display/canvas/graphics.d.ts +8 -5
- package/types/phaser/display/canvas/graphics.d.ts.map +1 -1
- package/types/phaser/display/canvas/masker.d.ts +5 -3
- package/types/phaser/display/canvas/masker.d.ts.map +1 -1
- package/types/phaser/display/canvas/pool.d.ts +20 -13
- package/types/phaser/display/canvas/pool.d.ts.map +1 -1
- package/types/phaser/display/canvas/renderer.d.ts +1 -1
- package/types/phaser/display/canvas/tinter.d.ts +19 -14
- package/types/phaser/display/canvas/tinter.d.ts.map +1 -1
- package/types/phaser/display/canvas/util.d.ts +47 -38
- package/types/phaser/display/canvas/util.d.ts.map +1 -1
- package/types/phaser/display/display_object.d.ts +5 -5
- package/types/phaser/display/display_object.d.ts.map +1 -1
- package/types/phaser/display/graphics.d.ts +28 -21
- package/types/phaser/display/graphics.d.ts.map +1 -1
- package/types/phaser/display/graphics_data.d.ts +1 -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 +14 -6
- package/types/phaser/display/group.d.ts.map +1 -1
- package/types/phaser/display/image.d.ts +16 -7
- package/types/phaser/display/image.d.ts.map +1 -1
- package/types/phaser/display/sprite_batch.d.ts +9 -4
- package/types/phaser/display/sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/sprite_util.d.ts +19 -14
- package/types/phaser/display/sprite_util.d.ts.map +1 -1
- package/types/phaser/display/text.d.ts +25 -16
- package/types/phaser/display/text.d.ts.map +1 -1
- package/types/phaser/display/webgl/abstract_filter.d.ts +3 -3
- package/types/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
- package/types/phaser/display/webgl/base_texture.d.ts +1 -1
- package/types/phaser/display/webgl/base_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/blend_manager.d.ts +2 -2
- package/types/phaser/display/webgl/earcut.d.ts +133 -106
- package/types/phaser/display/webgl/earcut.d.ts.map +1 -1
- package/types/phaser/display/webgl/earcut_node.d.ts +2 -2
- 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/filter_manager.d.ts +2 -2
- package/types/phaser/display/webgl/filter_texture.d.ts +1 -1
- package/types/phaser/display/webgl/graphics.d.ts +41 -31
- package/types/phaser/display/webgl/graphics.d.ts.map +1 -1
- package/types/phaser/display/webgl/graphics_data.d.ts +2 -2
- package/types/phaser/display/webgl/mask_manager.d.ts +6 -4
- package/types/phaser/display/webgl/mask_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/render_texture.d.ts +6 -6
- package/types/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/renderer.d.ts +7 -7
- package/types/phaser/display/webgl/renderer.d.ts.map +1 -1
- package/types/phaser/display/webgl/shader/complex.d.ts +1 -1
- package/types/phaser/display/webgl/shader/fast.d.ts +1 -1
- package/types/phaser/display/webgl/shader/normal.d.ts +1 -1
- package/types/phaser/display/webgl/shader/primitive.d.ts +1 -1
- package/types/phaser/display/webgl/shader/strip.d.ts +1 -1
- package/types/phaser/display/webgl/shader_manager.d.ts +6 -6
- package/types/phaser/display/webgl/shader_manager.d.ts.map +1 -1
- package/types/phaser/display/webgl/sprite_batch.d.ts +2 -2
- package/types/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
- package/types/phaser/display/webgl/stencil_manager.d.ts +1 -1
- package/types/phaser/display/webgl/texture.d.ts +1 -1
- package/types/phaser/display/webgl/texture.d.ts.map +1 -1
- package/types/phaser/display/webgl/texture_util.d.ts +10 -8
- package/types/phaser/display/webgl/texture_util.d.ts.map +1 -1
- package/types/phaser/display/webgl/util.d.ts +20 -16
- package/types/phaser/display/webgl/util.d.ts.map +1 -1
- package/types/phaser/geom/circle.d.ts +16 -9
- package/types/phaser/geom/circle.d.ts.map +1 -1
- package/types/phaser/geom/ellipse.d.ts +13 -5
- package/types/phaser/geom/ellipse.d.ts.map +1 -1
- package/types/phaser/geom/line.d.ts +16 -8
- package/types/phaser/geom/line.d.ts.map +1 -1
- package/types/phaser/geom/matrix.d.ts +21 -11
- package/types/phaser/geom/matrix.d.ts.map +1 -1
- package/types/phaser/geom/point.d.ts +26 -20
- package/types/phaser/geom/point.d.ts.map +1 -1
- package/types/phaser/geom/polygon.d.ts +4 -4
- package/types/phaser/geom/polygon.d.ts.map +1 -1
- package/types/phaser/geom/rectangle.d.ts +22 -14
- package/types/phaser/geom/rectangle.d.ts.map +1 -1
- package/types/phaser/geom/rounded_rectangle.d.ts +11 -2
- package/types/phaser/geom/rounded_rectangle.d.ts.map +1 -1
- package/types/phaser/geom/util/circle.d.ts +42 -33
- package/types/phaser/geom/util/circle.d.ts.map +1 -1
- package/types/phaser/geom/util/ellipse.d.ts +7 -12
- package/types/phaser/geom/util/ellipse.d.ts.map +1 -1
- package/types/phaser/geom/util/line.d.ts +30 -23
- package/types/phaser/geom/util/line.d.ts.map +1 -1
- package/types/phaser/geom/util/matrix.d.ts +12 -10
- package/types/phaser/geom/util/matrix.d.ts.map +1 -1
- package/types/phaser/geom/util/point.d.ts +118 -96
- package/types/phaser/geom/util/point.d.ts.map +1 -1
- package/types/phaser/geom/util/polygon.d.ts +6 -11
- package/types/phaser/geom/util/polygon.d.ts.map +1 -1
- package/types/phaser/geom/util/rectangle.d.ts +91 -74
- package/types/phaser/geom/util/rectangle.d.ts.map +1 -1
- package/types/phaser/geom/util/rounded_rectangle.d.ts +6 -11
- package/types/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
- package/types/phaser/util/math.d.ts +89 -69
- package/types/phaser/util/math.d.ts.map +1 -1
- package/tsconfig.json +0 -110
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export class GraphicsData {
|
|
9
9
|
constructor(gl) {
|
|
10
10
|
this.gl = gl;
|
|
11
11
|
// TODO does this need to be split before uploading??
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
7
|
import { updateGraphics } from './graphics';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
+
* TBD.
|
|
10
11
|
*
|
|
11
|
-
* @param {object} maskData TBD
|
|
12
|
-
* @param {object} renderSession TBD
|
|
12
|
+
* @param {object} maskData - TBD.
|
|
13
|
+
* @param {object} renderSession - TBD.
|
|
13
14
|
*/
|
|
14
15
|
export function pushMask(maskData, renderSession) {
|
|
15
16
|
const gl = renderSession.gl;
|
|
@@ -27,9 +28,10 @@ export function pushMask(maskData, renderSession) {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
/**
|
|
31
|
+
* TBD.
|
|
30
32
|
*
|
|
31
|
-
* @param {object} maskData TBD
|
|
32
|
-
* @param {object} renderSession TBD
|
|
33
|
+
* @param {object} maskData - TBD.
|
|
34
|
+
* @param {object} renderSession - TBD.
|
|
33
35
|
*/
|
|
34
36
|
export function popMask(maskData, renderSession) {
|
|
35
37
|
const gl = renderSession.gl;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
|
-
import Rectangle from
|
|
8
|
-
import Point from '../../geom/point';
|
|
9
|
-
import Texture from './texture';
|
|
10
|
-
import BaseTexture from './base_texture';
|
|
11
|
-
import FilterTexture from './filter_texture';
|
|
12
|
-
import CanvasBuffer from '../canvas/buffer';
|
|
7
|
+
import { Rectangle } from '../../geom/rectangle';
|
|
8
|
+
import { Point } from '../../geom/point';
|
|
9
|
+
import { Texture } from './texture';
|
|
10
|
+
import { BaseTexture } from './base_texture';
|
|
11
|
+
import { FilterTexture } from './filter_texture';
|
|
12
|
+
import { CanvasBuffer } from '../canvas/buffer';
|
|
13
13
|
import { RENDER_WEBGL } from '../../core/const';
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export class RenderTexture extends Texture {
|
|
16
16
|
constructor(width, height, renderer, scaleMode, resolution = 1) {
|
|
17
17
|
const w = width || 100;
|
|
18
18
|
const h = height || 100;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
7
|
import {
|
|
8
8
|
RENDER_WEBGL,
|
|
@@ -27,15 +27,15 @@ import {
|
|
|
27
27
|
} from '../../core/const';
|
|
28
28
|
import { remove } from '../canvas/pool';
|
|
29
29
|
import { isPowerOfTwo } from '../../util/math';
|
|
30
|
-
import Point from '../../geom/point';
|
|
31
|
-
import WebGLShaderManager from './shader_manager';
|
|
32
|
-
import WebGLSpriteBatch from './sprite_batch';
|
|
30
|
+
import { Point } from '../../geom/point';
|
|
31
|
+
import { WebGLShaderManager } from './shader_manager';
|
|
32
|
+
import { WebGLSpriteBatch } from './sprite_batch';
|
|
33
33
|
import * as WebGLMaskManager from './mask_manager';
|
|
34
|
-
import WebGLFilterManager from './filter_manager';
|
|
35
|
-
import WebGLStencilManager from './stencil_manager';
|
|
36
|
-
import WebGLBlendModeManager from './blend_manager';
|
|
34
|
+
import { WebGLFilterManager } from './filter_manager';
|
|
35
|
+
import { WebGLStencilManager } from './stencil_manager';
|
|
36
|
+
import { WebGLBlendModeManager } from './blend_manager';
|
|
37
37
|
|
|
38
|
-
export
|
|
38
|
+
export class WebGLRenderer {
|
|
39
39
|
constructor(game) {
|
|
40
40
|
this.type = RENDER_WEBGL;
|
|
41
41
|
this.resolution = game.config.resolution;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
7
|
import { generateShaderID } from '../../../util/math';
|
|
8
8
|
import { compileProgram } from '../util';
|
|
9
9
|
|
|
10
10
|
// the next one is used for rendering triangle strips
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export class ComplexPrimitiveShader {
|
|
13
13
|
constructor(gl) {
|
|
14
14
|
this.gl = gl;
|
|
15
15
|
this._UID = generateShaderID();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
7
|
import { generateShaderID } from '../../../util/math';
|
|
8
8
|
import { compileProgram } from '../util';
|
|
9
9
|
|
|
10
10
|
// this shader is used for the fast sprite rendering
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export class FastShader {
|
|
13
13
|
constructor(gl) {
|
|
14
14
|
this.gl = gl;
|
|
15
15
|
this._UID = generateShaderID();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
7
|
import { generateShaderID } from '../../../util/math';
|
|
8
8
|
import { compileProgram } from '../util';
|
|
@@ -29,7 +29,7 @@ const defaultVertexSrc = [
|
|
|
29
29
|
|
|
30
30
|
// this shader is used for the default sprite rendering
|
|
31
31
|
|
|
32
|
-
export
|
|
32
|
+
export class NormalShader {
|
|
33
33
|
constructor(gl) {
|
|
34
34
|
this.gl = gl;
|
|
35
35
|
this._UID = generateShaderID();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
7
|
import { generateShaderID } from '../../../util/math';
|
|
8
8
|
import { compileProgram } from '../util';
|
|
9
9
|
|
|
10
10
|
// the next one is used for rendering primitives
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export class PrimitiveShader {
|
|
13
13
|
constructor(gl) {
|
|
14
14
|
this.gl = gl;
|
|
15
15
|
this._UID = generateShaderID();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
7
|
import { generateShaderID } from '../../../util/math';
|
|
8
8
|
import { compileProgram } from '../util';
|
|
9
9
|
|
|
10
10
|
// the next one is used for rendering triangle strips
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export class StripShader {
|
|
13
13
|
constructor(gl) {
|
|
14
14
|
this.gl = gl;
|
|
15
15
|
this._UID = generateShaderID();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
|
-
import PrimitiveShader from './shader/primitive';
|
|
8
|
-
import ComplexPrimitiveShader from './shader/complex';
|
|
9
|
-
import NormalShader from './shader/normal';
|
|
10
|
-
import FastShader from './shader/fast';
|
|
11
|
-
import StripShader from './shader/strip';
|
|
7
|
+
import { PrimitiveShader } from './shader/primitive';
|
|
8
|
+
import { ComplexPrimitiveShader } from './shader/complex';
|
|
9
|
+
import { NormalShader } from './shader/normal';
|
|
10
|
+
import { FastShader } from './shader/fast';
|
|
11
|
+
import { StripShader } from './shader/strip';
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export class WebGLShaderManager {
|
|
14
14
|
constructor() {
|
|
15
15
|
this.gl = null;
|
|
16
16
|
this.primitiveShader = null;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
|
-
import AbstractFilter from './abstract_filter';
|
|
8
|
-
import NormalShader from './shader/normal';
|
|
9
|
-
|
|
10
|
-
// TODO: fix ++ +=1 conversion issues (when a is 0 than a++ is 0 but a+=1 is 1)
|
|
7
|
+
import { AbstractFilter } from './abstract_filter';
|
|
8
|
+
import { NormalShader } from './shader/normal';
|
|
11
9
|
|
|
12
|
-
export
|
|
10
|
+
export class WebGLSpriteBatch {
|
|
13
11
|
constructor() {
|
|
14
12
|
this.vertSize = 5;
|
|
15
13
|
this.size = 2000; // Math.pow(2, 16) / this.vertSize;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
7
|
import { hex2rgb } from '../../util/math';
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export class WebGLStencilManager {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.stencilStack = [];
|
|
12
12
|
this.reverse = true;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @module display/webgl/texture
|
|
3
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
4
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
5
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
6
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
7
|
*/
|
|
7
|
-
import Rectangle from
|
|
8
|
+
import { Rectangle } from '../../geom/rectangle';
|
|
8
9
|
|
|
9
10
|
export class TextureUvs {
|
|
10
11
|
constructor() {
|
|
@@ -19,7 +20,7 @@ export class TextureUvs {
|
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
export
|
|
23
|
+
export class Texture {
|
|
23
24
|
constructor(baseTexture, frame, crop, trim) {
|
|
24
25
|
this.noFrame = false;
|
|
25
26
|
if (!frame) {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
|
-
import BaseTexture from './base_texture';
|
|
8
|
-
import Texture from './texture';
|
|
7
|
+
import { BaseTexture } from './base_texture';
|
|
8
|
+
import { Texture } from './texture';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
+
* TBD.
|
|
11
12
|
*
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {number} scaleMode TBD
|
|
14
|
-
* @returns {object} TBD
|
|
13
|
+
* @param {HTMLCanvasElement} canvas - TBD.
|
|
14
|
+
* @param {number} scaleMode - TBD.
|
|
15
|
+
* @returns {object} TBD.
|
|
15
16
|
*/
|
|
16
17
|
export function baseTextureFromCanvas(canvas, scaleMode) {
|
|
17
18
|
if (canvas.width === 0) {
|
|
@@ -24,10 +25,11 @@ export function baseTextureFromCanvas(canvas, scaleMode) {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
/**
|
|
28
|
+
* TBD.
|
|
27
29
|
*
|
|
28
|
-
* @param {
|
|
29
|
-
* @param {number} scaleMode TBD
|
|
30
|
-
* @returns {object} TBD
|
|
30
|
+
* @param {HTMLCanvasElement} canvas - TBD.
|
|
31
|
+
* @param {number} scaleMode - TBD.
|
|
32
|
+
* @returns {object} TBD.
|
|
31
33
|
*/
|
|
32
34
|
export function textureFromCanvas(canvas, scaleMode) {
|
|
33
35
|
return new Texture(baseTextureFromCanvas(canvas, scaleMode));
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
3
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
4
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
5
|
* @author Mat Groves http://matgroves.com/ @Doormat23
|
|
5
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* TBD.
|
|
10
10
|
*/
|
|
11
11
|
export function initDefaultShaders() {}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
+
* TBD.
|
|
14
15
|
*
|
|
15
|
-
* @param {object} gl TBD
|
|
16
|
-
* @param {string[]|string} shaderSrc TBD
|
|
17
|
-
* @param {object} shaderType TBD
|
|
18
|
-
* @returns {object} TBD
|
|
16
|
+
* @param {object} gl - TBD.
|
|
17
|
+
* @param {string[]|string} shaderSrc - TBD.
|
|
18
|
+
* @param {object} shaderType - TBD.
|
|
19
|
+
* @returns {object} TBD.
|
|
19
20
|
*/
|
|
20
21
|
export function compileShader(gl, shaderSrc, shaderType) {
|
|
21
22
|
let src = shaderSrc;
|
|
@@ -35,31 +36,34 @@ export function compileShader(gl, shaderSrc, shaderType) {
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
/**
|
|
39
|
+
* TBD.
|
|
38
40
|
*
|
|
39
|
-
* @param {object} gl TBD
|
|
40
|
-
* @param {string[]|string} shaderSrc TBD
|
|
41
|
-
* @returns {object} TBD
|
|
41
|
+
* @param {object} gl - TBD.
|
|
42
|
+
* @param {string[]|string} shaderSrc - TBD.
|
|
43
|
+
* @returns {object} TBD.
|
|
42
44
|
*/
|
|
43
45
|
export function compileVertexShader(gl, shaderSrc) {
|
|
44
46
|
return compileShader(gl, shaderSrc, gl.VERTEX_SHADER);
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
/**
|
|
50
|
+
* TBD.
|
|
48
51
|
*
|
|
49
|
-
* @param {object} gl TBD
|
|
50
|
-
* @param {string[]|string} shaderSrc TBD
|
|
51
|
-
* @returns {object} TBD
|
|
52
|
+
* @param {object} gl - TBD.
|
|
53
|
+
* @param {string[]|string} shaderSrc - TBD.
|
|
54
|
+
* @returns {object} TBD.
|
|
52
55
|
*/
|
|
53
56
|
export function compileFragmentShader(gl, shaderSrc) {
|
|
54
57
|
return compileShader(gl, shaderSrc, gl.FRAGMENT_SHADER);
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
/**
|
|
61
|
+
* TBD.
|
|
58
62
|
*
|
|
59
|
-
* @param {object} gl TBD
|
|
60
|
-
* @param {string[]|string} vertexSrc TBD
|
|
61
|
-
* @param {string[]|string} fragmentSrc TBD
|
|
62
|
-
* @returns {object} TBD
|
|
63
|
+
* @param {object} gl - TBD.
|
|
64
|
+
* @param {string[]|string} vertexSrc - TBD.
|
|
65
|
+
* @param {string[]|string} fragmentSrc - TBD.
|
|
66
|
+
* @returns {object} TBD.
|
|
63
67
|
*/
|
|
64
68
|
export function compileProgram(gl, vertexSrc, fragmentSrc) {
|
|
65
69
|
const fragmentShader = compileFragmentShader(gl, fragmentSrc);
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @module geom/circle
|
|
3
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
4
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
5
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
5
6
|
*/
|
|
6
|
-
import Point from './point';
|
|
7
|
-
import Rectangle from
|
|
7
|
+
import { Point } from './point';
|
|
8
|
+
import { Rectangle } from './rectangle';
|
|
8
9
|
import { distance } from '../util/math';
|
|
9
10
|
import { clone, contains, circumferencePoint } from './util/circle';
|
|
10
11
|
import { GEOM_CIRCLE } from '../core/const';
|
|
11
12
|
|
|
12
|
-
export
|
|
13
|
+
export class Circle {
|
|
14
|
+
/**
|
|
15
|
+
* TBD.
|
|
16
|
+
*
|
|
17
|
+
* @param {number} x - TBD.
|
|
18
|
+
* @param {number} y - TBD.
|
|
19
|
+
* @param {number} diameter - TBD.
|
|
20
|
+
*/
|
|
13
21
|
constructor(x = 0, y = 0, diameter = 0) {
|
|
14
22
|
this.x = x;
|
|
15
23
|
this.y = y;
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @module geom/ellipse
|
|
3
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
4
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
5
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
5
6
|
*/
|
|
6
|
-
import Point from './point';
|
|
7
|
-
import Rectangle from
|
|
7
|
+
import { Point } from './point';
|
|
8
|
+
import { Rectangle } from './rectangle';
|
|
8
9
|
import { contains } from './util/ellipse';
|
|
9
10
|
import { GEOM_ELLIPSE } from '../core/const';
|
|
10
11
|
|
|
11
|
-
export
|
|
12
|
+
export class Ellipse {
|
|
13
|
+
/**
|
|
14
|
+
* TBD.
|
|
15
|
+
*
|
|
16
|
+
* @param {number} x - TBD.
|
|
17
|
+
* @param {number} y - TBD.
|
|
18
|
+
* @param {number} width - TBD.
|
|
19
|
+
* @param {number} height - TBD.
|
|
20
|
+
*/
|
|
12
21
|
constructor(x = 0, y = 0, width = 0, height = 0) {
|
|
13
22
|
this.x = x;
|
|
14
23
|
this.y = y;
|
package/src/phaser/geom/line.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @module geom/line
|
|
3
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
4
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
5
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
5
6
|
*/
|
|
6
|
-
import Point from './point';
|
|
7
|
+
import { Point } from './point';
|
|
7
8
|
import { clone, intersectsPoints, reflect } from './util/line';
|
|
8
9
|
import { wrap } from '../util/math';
|
|
9
10
|
import { GEOM_LINE } from '../core/const';
|
|
10
11
|
|
|
11
|
-
export
|
|
12
|
+
export class Line {
|
|
13
|
+
/**
|
|
14
|
+
* TBD.
|
|
15
|
+
*
|
|
16
|
+
* @param {number} x1 - TBD.
|
|
17
|
+
* @param {number} y1 - TBD.
|
|
18
|
+
* @param {number} x2 - TBD.
|
|
19
|
+
* @param {number} y2 - TBD.
|
|
20
|
+
*/
|
|
12
21
|
constructor(x1 = 0, y1 = 0, x2 = 0, y2 = 0) {
|
|
13
22
|
this.start = new Point(x1, y1);
|
|
14
23
|
this.end = new Point(x2, y2);
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @module geom/matrix
|
|
3
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
4
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
5
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
5
6
|
*/
|
|
6
|
-
import Point from './point';
|
|
7
|
+
import { Point } from './point';
|
|
7
8
|
import { clone } from './util/matrix';
|
|
8
9
|
import { GEOM_MATRIX } from '../core/const';
|
|
9
10
|
|
|
10
|
-
export
|
|
11
|
+
export class Matrix {
|
|
12
|
+
/**
|
|
13
|
+
* TBD.
|
|
14
|
+
*
|
|
15
|
+
* @param {number} a - TBD.
|
|
16
|
+
* @param {number} b - TBD.
|
|
17
|
+
* @param {number} c - TBD.
|
|
18
|
+
* @param {number} d - TBD.
|
|
19
|
+
* @param {number} tx - TBD.
|
|
20
|
+
* @param {number} ty - TBD.
|
|
21
|
+
*/
|
|
11
22
|
constructor(a = 1, b = 0, c = 0, d = 1, tx = 0, ty = 0) {
|
|
12
23
|
this.a = a;
|
|
13
24
|
this.b = b;
|
package/src/phaser/geom/point.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @module geom/point
|
|
3
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
4
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
5
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
5
6
|
*/
|
|
6
7
|
import { distance, rotate, clone } from './util/point';
|
|
7
8
|
import { GEOM_POINT } from '../core/const';
|
|
8
9
|
|
|
9
|
-
export
|
|
10
|
+
export class Point {
|
|
11
|
+
/**
|
|
12
|
+
* TBD.
|
|
13
|
+
*
|
|
14
|
+
* @param {number} x - TBD.
|
|
15
|
+
* @param {number} y - TBD.
|
|
16
|
+
*/
|
|
10
17
|
constructor(x = 0, y = 0) {
|
|
11
18
|
this.x = x;
|
|
12
19
|
this.y = y;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @module geom/polygon
|
|
3
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
4
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
5
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
5
6
|
*/
|
|
6
|
-
import Point from './point';
|
|
7
|
+
import { Point } from './point';
|
|
7
8
|
import { clone } from './util/polygon';
|
|
8
9
|
import { GEOM_POLYGON } from '../core/const';
|
|
9
10
|
|
|
10
|
-
export
|
|
11
|
+
export class Polygon {
|
|
11
12
|
constructor(points = null) {
|
|
12
13
|
this.area = 0;
|
|
13
14
|
this._points = [];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @module geom/rectangle
|
|
3
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
4
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
5
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
5
6
|
*/
|
|
6
|
-
import Point from './point';
|
|
7
|
+
import { Point } from './point';
|
|
7
8
|
import {
|
|
8
9
|
inflate,
|
|
9
10
|
size,
|
|
@@ -29,7 +30,15 @@ import {
|
|
|
29
30
|
BOTTOM_RIGHT,
|
|
30
31
|
} from '../core/const';
|
|
31
32
|
|
|
32
|
-
export
|
|
33
|
+
export class Rectangle {
|
|
34
|
+
/**
|
|
35
|
+
* TBD.
|
|
36
|
+
*
|
|
37
|
+
* @param {number} x - TBD.
|
|
38
|
+
* @param {number} y - TBD.
|
|
39
|
+
* @param {number} width - TBD.
|
|
40
|
+
* @param {number} height - TBD.
|
|
41
|
+
*/
|
|
33
42
|
constructor(x = 0, y = 0, width = 0, height = 0) {
|
|
34
43
|
this.x = x;
|
|
35
44
|
this.y = y;
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @module geom/rounded_rectangle
|
|
3
|
+
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
2
4
|
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
5
|
* @author Richard Davey <rich@photonstorm.com>
|
|
4
|
-
* @copyright Copyright (c) 2018-present Richard Davey, Photon Storm Ltd., Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)
|
|
5
6
|
*/
|
|
6
7
|
import { clone } from './util/rounded_rectangle';
|
|
7
8
|
import { GEOM_ROUNDED_RECTANGLE } from '../core/const';
|
|
8
9
|
|
|
9
|
-
export
|
|
10
|
+
export class RoundedRectangle {
|
|
11
|
+
/**
|
|
12
|
+
* TBD.
|
|
13
|
+
*
|
|
14
|
+
* @param {number} x - TBD.
|
|
15
|
+
* @param {number} y - TBD.
|
|
16
|
+
* @param {number} width - TBD.
|
|
17
|
+
* @param {number} height - TBD.
|
|
18
|
+
* @param {number} radius - TBD.
|
|
19
|
+
*/
|
|
10
20
|
constructor(x = 0, y = 0, width = 0, height = 0, radius = 20) {
|
|
11
21
|
this.x = x;
|
|
12
22
|
this.y = y;
|