@vpmedia/phaser 1.11.0 → 1.12.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 +8 -5
- package/src/phaser/core/animation.js +9 -6
- package/src/phaser/core/animation_manager.js +14 -4
- package/src/phaser/core/animation_parser.js +24 -3
- package/src/phaser/core/array_set.js +1 -3
- package/src/phaser/core/cache.js +6 -6
- package/src/phaser/core/device.js +0 -2
- package/src/phaser/core/device_util.js +21 -6
- package/src/phaser/core/dom.js +34 -25
- package/src/phaser/core/event_manager.js +45 -17
- package/src/phaser/core/factory.js +26 -4
- package/src/phaser/core/frame.js +0 -2
- package/src/phaser/core/frame_data.js +0 -2
- package/src/phaser/core/game.js +8 -6
- package/src/phaser/core/input.js +17 -9
- package/src/phaser/core/input_handler.js +100 -26
- package/src/phaser/core/input_mouse.js +10 -14
- package/src/phaser/core/input_mspointer.js +10 -9
- package/src/phaser/core/input_pointer.js +58 -17
- package/src/phaser/core/input_touch.js +6 -8
- package/src/phaser/core/loader.js +168 -51
- package/src/phaser/core/loader_parser.js +4 -1
- package/src/phaser/core/raf.js +0 -2
- package/src/phaser/core/scale_manager.js +69 -25
- package/src/phaser/core/scene.js +0 -2
- package/src/phaser/core/scene_manager.js +6 -3
- package/src/phaser/core/signal.js +15 -8
- package/src/phaser/core/signal_binding.js +10 -5
- package/src/phaser/core/sound.js +20 -11
- package/src/phaser/core/sound_manager.js +56 -20
- package/src/phaser/core/sound_sprite.js +32 -32
- package/src/phaser/core/stage.js +0 -3
- package/src/phaser/core/time.js +0 -2
- package/src/phaser/core/timer.js +24 -7
- package/src/phaser/core/timer_event.js +0 -2
- package/src/phaser/core/tween.js +32 -8
- package/src/phaser/core/tween_data.js +15 -7
- package/src/phaser/core/tween_easing.js +24 -20
- package/src/phaser/core/tween_manager.js +31 -13
- package/src/phaser/core/world.js +0 -2
- package/src/phaser/display/bitmap_text.js +8 -9
- package/src/phaser/display/button.js +16 -4
- package/src/phaser/display/canvas/buffer.js +0 -2
- package/src/phaser/display/canvas/graphics.js +21 -9
- package/src/phaser/display/canvas/masker.js +1 -1
- package/src/phaser/display/canvas/renderer.js +39 -19
- package/src/phaser/display/canvas/tinter.js +43 -6
- package/src/phaser/display/canvas/util.js +1 -1
- package/src/phaser/display/display_object.js +33 -19
- package/src/phaser/display/graphics.js +52 -27
- package/src/phaser/display/graphics_data.js +0 -2
- package/src/phaser/display/graphics_data_util.js +9 -1
- package/src/phaser/display/group.js +1 -4
- package/src/phaser/display/image.js +2 -4
- package/src/phaser/display/sprite_batch.js +0 -2
- package/src/phaser/display/sprite_util.js +46 -11
- package/src/phaser/display/text.js +77 -26
- package/src/phaser/display/webgl/abstract_filter.js +0 -2
- package/src/phaser/display/webgl/base_texture.js +5 -3
- package/src/phaser/display/webgl/blend_manager.js +0 -2
- package/src/phaser/display/webgl/earcut.js +63 -22
- package/src/phaser/display/webgl/earcut_node.js +0 -2
- package/src/phaser/display/webgl/fast_sprite_batch.js +47 -46
- package/src/phaser/display/webgl/filter_manager.js +0 -2
- package/src/phaser/display/webgl/filter_texture.js +16 -5
- package/src/phaser/display/webgl/graphics.js +38 -16
- package/src/phaser/display/webgl/graphics_data.js +0 -2
- package/src/phaser/display/webgl/mask_manager.js +10 -2
- package/src/phaser/display/webgl/render_texture.js +14 -5
- package/src/phaser/display/webgl/renderer.js +39 -7
- package/src/phaser/display/webgl/shader/complex.js +0 -2
- package/src/phaser/display/webgl/shader/fast.js +8 -3
- package/src/phaser/display/webgl/shader/normal.js +42 -14
- package/src/phaser/display/webgl/shader/primitive.js +0 -2
- package/src/phaser/display/webgl/shader/strip.js +0 -2
- package/src/phaser/display/webgl/shader_manager.js +0 -2
- package/src/phaser/display/webgl/sprite_batch.js +13 -14
- package/src/phaser/display/webgl/stencil_manager.js +18 -20
- package/src/phaser/display/webgl/texture.js +10 -7
- package/src/phaser/display/webgl/util.js +1 -2
- package/src/phaser/geom/circle.js +15 -7
- package/src/phaser/geom/ellipse.js +13 -6
- package/src/phaser/geom/line.js +19 -10
- package/src/phaser/geom/matrix.js +0 -2
- package/src/phaser/geom/point.js +9 -11
- package/src/phaser/geom/polygon.js +9 -5
- package/src/phaser/geom/rectangle.js +44 -10
- package/src/phaser/geom/rounded_rectangle.js +0 -2
- package/src/phaser/geom/util/circle.js +3 -3
- package/src/phaser/geom/util/ellipse.js +3 -3
- package/src/phaser/geom/util/line.js +16 -13
- package/src/phaser/geom/util/point.js +1 -1
- package/src/phaser/geom/util/rectangle.js +17 -7
- package/src/phaser/util/math.js +37 -23
- package/tsconfig.json +110 -0
- package/types/index.d.ts +22 -0
- package/types/index.d.ts.map +1 -0
- package/types/phaser/core/animation.d.ts +55 -0
- package/types/phaser/core/animation.d.ts.map +1 -0
- package/types/phaser/core/animation_manager.d.ts +35 -0
- package/types/phaser/core/animation_manager.d.ts.map +1 -0
- package/types/phaser/core/animation_parser.d.ts +20 -0
- package/types/phaser/core/animation_parser.d.ts.map +1 -0
- package/types/phaser/core/array_set.d.ts +23 -0
- package/types/phaser/core/array_set.d.ts.map +1 -0
- package/types/phaser/core/cache.d.ts +106 -0
- package/types/phaser/core/cache.d.ts.map +1 -0
- package/types/phaser/core/const.d.ts +81 -0
- package/types/phaser/core/const.d.ts.map +1 -0
- package/types/phaser/core/device.d.ts +36 -0
- package/types/phaser/core/device.d.ts.map +1 -0
- package/types/phaser/core/device_util.d.ts +48 -0
- package/types/phaser/core/device_util.d.ts.map +1 -0
- package/types/phaser/core/dom.d.ts +63 -0
- package/types/phaser/core/dom.d.ts.map +1 -0
- package/types/phaser/core/event_manager.d.ts +53 -0
- package/types/phaser/core/event_manager.d.ts.map +1 -0
- package/types/phaser/core/factory.d.ts +12 -0
- package/types/phaser/core/factory.d.ts.map +1 -0
- package/types/phaser/core/frame.d.ts +30 -0
- package/types/phaser/core/frame.d.ts.map +1 -0
- package/types/phaser/core/frame_data.d.ts +14 -0
- package/types/phaser/core/frame_data.d.ts.map +1 -0
- package/types/phaser/core/frame_util.d.ts +15 -0
- package/types/phaser/core/frame_util.d.ts.map +1 -0
- package/types/phaser/core/game.d.ts +57 -0
- package/types/phaser/core/game.d.ts.map +1 -0
- package/types/phaser/core/input.d.ts +92 -0
- package/types/phaser/core/input.d.ts.map +1 -0
- package/types/phaser/core/input_handler.d.ts +111 -0
- package/types/phaser/core/input_handler.d.ts.map +1 -0
- package/types/phaser/core/input_mouse.d.ts +39 -0
- package/types/phaser/core/input_mouse.d.ts.map +1 -0
- package/types/phaser/core/input_mspointer.d.ts +34 -0
- package/types/phaser/core/input_mspointer.d.ts.map +1 -0
- package/types/phaser/core/input_pointer.d.ts +68 -0
- package/types/phaser/core/input_pointer.d.ts.map +1 -0
- package/types/phaser/core/input_touch.d.ts +37 -0
- package/types/phaser/core/input_touch.d.ts.map +1 -0
- package/types/phaser/core/loader.d.ts +94 -0
- package/types/phaser/core/loader.d.ts.map +1 -0
- package/types/phaser/core/loader_parser.d.ts +35 -0
- package/types/phaser/core/loader_parser.d.ts.map +1 -0
- package/types/phaser/core/raf.d.ts +15 -0
- package/types/phaser/core/raf.d.ts.map +1 -0
- package/types/phaser/core/scale_manager.d.ts +137 -0
- package/types/phaser/core/scale_manager.d.ts.map +1 -0
- package/types/phaser/core/scene.d.ts +17 -0
- package/types/phaser/core/scene.d.ts.map +1 -0
- package/types/phaser/core/scene_manager.d.ts +39 -0
- package/types/phaser/core/scene_manager.d.ts.map +1 -0
- package/types/phaser/core/signal.d.ts +25 -0
- package/types/phaser/core/signal.d.ts.map +1 -0
- package/types/phaser/core/signal_binding.d.ts +26 -0
- package/types/phaser/core/signal_binding.d.ts.map +1 -0
- package/types/phaser/core/sound.d.ts +72 -0
- package/types/phaser/core/sound.d.ts.map +1 -0
- package/types/phaser/core/sound_manager.d.ts +50 -0
- package/types/phaser/core/sound_manager.d.ts.map +1 -0
- package/types/phaser/core/sound_sprite.d.ts +18 -0
- package/types/phaser/core/sound_sprite.d.ts.map +1 -0
- package/types/phaser/core/stage.d.ts +23 -0
- package/types/phaser/core/stage.d.ts.map +1 -0
- package/types/phaser/core/time.d.ts +49 -0
- package/types/phaser/core/time.d.ts.map +1 -0
- package/types/phaser/core/timer.d.ts +49 -0
- package/types/phaser/core/timer.d.ts.map +1 -0
- package/types/phaser/core/timer_event.d.ts +18 -0
- package/types/phaser/core/timer_event.d.ts.map +1 -0
- package/types/phaser/core/tween.d.ts +52 -0
- package/types/phaser/core/tween.d.ts.map +1 -0
- package/types/phaser/core/tween_data.d.ts +37 -0
- package/types/phaser/core/tween_data.d.ts.map +1 -0
- package/types/phaser/core/tween_easing.d.ts +192 -0
- package/types/phaser/core/tween_easing.d.ts.map +1 -0
- package/types/phaser/core/tween_manager.d.ts +94 -0
- package/types/phaser/core/tween_manager.d.ts.map +1 -0
- package/types/phaser/core/world.d.ts +6 -0
- package/types/phaser/core/world.d.ts.map +1 -0
- package/types/phaser/display/bitmap_text.d.ts +48 -0
- package/types/phaser/display/bitmap_text.d.ts.map +1 -0
- package/types/phaser/display/button.d.ts +33 -0
- package/types/phaser/display/button.d.ts.map +1 -0
- package/types/phaser/display/canvas/buffer.d.ts +11 -0
- package/types/phaser/display/canvas/buffer.d.ts.map +1 -0
- package/types/phaser/display/canvas/graphics.d.ts +18 -0
- package/types/phaser/display/canvas/graphics.d.ts.map +1 -0
- package/types/phaser/display/canvas/masker.d.ts +12 -0
- package/types/phaser/display/canvas/masker.d.ts.map +1 -0
- package/types/phaser/display/canvas/pool.d.ts +45 -0
- package/types/phaser/display/canvas/pool.d.ts.map +1 -0
- package/types/phaser/display/canvas/renderer.d.ts +28 -0
- package/types/phaser/display/canvas/renderer.d.ts.map +1 -0
- package/types/phaser/display/canvas/tinter.d.ts +36 -0
- package/types/phaser/display/canvas/tinter.d.ts.map +1 -0
- package/types/phaser/display/canvas/util.d.ts +70 -0
- package/types/phaser/display/canvas/util.d.ts.map +1 -0
- package/types/phaser/display/display_object.d.ts +83 -0
- package/types/phaser/display/display_object.d.ts.map +1 -0
- package/types/phaser/display/graphics.d.ts +53 -0
- package/types/phaser/display/graphics.d.ts.map +1 -0
- package/types/phaser/display/graphics_data.d.ts +15 -0
- package/types/phaser/display/graphics_data.d.ts.map +1 -0
- package/types/phaser/display/graphics_data_util.d.ts +7 -0
- package/types/phaser/display/graphics_data_util.d.ts.map +1 -0
- package/types/phaser/display/group.d.ts +41 -0
- package/types/phaser/display/group.d.ts.map +1 -0
- package/types/phaser/display/image.d.ts +43 -0
- package/types/phaser/display/image.d.ts.map +1 -0
- package/types/phaser/display/sprite_batch.d.ts +6 -0
- package/types/phaser/display/sprite_batch.d.ts.map +1 -0
- package/types/phaser/display/sprite_util.d.ts +35 -0
- package/types/phaser/display/sprite_util.d.ts.map +1 -0
- package/types/phaser/display/text.d.ts +116 -0
- package/types/phaser/display/text.d.ts.map +1 -0
- package/types/phaser/display/webgl/abstract_filter.d.ts +17 -0
- package/types/phaser/display/webgl/abstract_filter.d.ts.map +1 -0
- package/types/phaser/display/webgl/base_texture.d.ts +20 -0
- package/types/phaser/display/webgl/base_texture.d.ts.map +1 -0
- package/types/phaser/display/webgl/blend_manager.d.ts +14 -0
- package/types/phaser/display/webgl/blend_manager.d.ts.map +1 -0
- package/types/phaser/display/webgl/earcut.d.ts +215 -0
- package/types/phaser/display/webgl/earcut.d.ts.map +1 -0
- package/types/phaser/display/webgl/earcut_node.d.ts +19 -0
- package/types/phaser/display/webgl/earcut_node.d.ts.map +1 -0
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts +34 -0
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -0
- package/types/phaser/display/webgl/filter_manager.d.ts +21 -0
- package/types/phaser/display/webgl/filter_manager.d.ts.map +1 -0
- package/types/phaser/display/webgl/filter_texture.d.ts +13 -0
- package/types/phaser/display/webgl/filter_texture.d.ts.map +1 -0
- package/types/phaser/display/webgl/graphics.d.ts +80 -0
- package/types/phaser/display/webgl/graphics.d.ts.map +1 -0
- package/types/phaser/display/webgl/graphics_data.d.ts +23 -0
- package/types/phaser/display/webgl/graphics_data.d.ts.map +1 -0
- package/types/phaser/display/webgl/mask_manager.d.ts +13 -0
- package/types/phaser/display/webgl/mask_manager.d.ts.map +1 -0
- package/types/phaser/display/webgl/render_texture.d.ts +25 -0
- package/types/phaser/display/webgl/render_texture.d.ts.map +1 -0
- package/types/phaser/display/webgl/renderer.d.ts +44 -0
- package/types/phaser/display/webgl/renderer.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader/complex.d.ts +22 -0
- package/types/phaser/display/webgl/shader/complex.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader/fast.d.ts +25 -0
- package/types/phaser/display/webgl/shader/fast.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader/normal.d.ts +25 -0
- package/types/phaser/display/webgl/shader/normal.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader/primitive.d.ts +21 -0
- package/types/phaser/display/webgl/shader/primitive.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader/strip.d.ts +22 -0
- package/types/phaser/display/webgl/shader/strip.d.ts.map +1 -0
- package/types/phaser/display/webgl/shader_manager.d.ts +24 -0
- package/types/phaser/display/webgl/shader_manager.d.ts.map +1 -0
- package/types/phaser/display/webgl/sprite_batch.d.ts +36 -0
- package/types/phaser/display/webgl/sprite_batch.d.ts.map +1 -0
- package/types/phaser/display/webgl/stencil_manager.d.ts +12 -0
- package/types/phaser/display/webgl/stencil_manager.d.ts.map +1 -0
- package/types/phaser/display/webgl/texture.d.ts +30 -0
- package/types/phaser/display/webgl/texture.d.ts.map +1 -0
- package/types/phaser/display/webgl/texture_util.d.ts +15 -0
- package/types/phaser/display/webgl/texture_util.d.ts.map +1 -0
- package/types/phaser/display/webgl/util.d.ts +41 -0
- package/types/phaser/display/webgl/util.d.ts.map +1 -0
- package/types/phaser/geom/circle.d.ts +39 -0
- package/types/phaser/geom/circle.d.ts.map +1 -0
- package/types/phaser/geom/ellipse.d.ts +18 -0
- package/types/phaser/geom/ellipse.d.ts.map +1 -0
- package/types/phaser/geom/line.d.ts +37 -0
- package/types/phaser/geom/line.d.ts.map +1 -0
- package/types/phaser/geom/matrix.d.ts +25 -0
- package/types/phaser/geom/matrix.d.ts.map +1 -0
- package/types/phaser/geom/point.d.ts +37 -0
- package/types/phaser/geom/point.d.ts.map +1 -0
- package/types/phaser/geom/polygon.d.ts +17 -0
- package/types/phaser/geom/polygon.d.ts.map +1 -0
- package/types/phaser/geom/rectangle.d.ts +63 -0
- package/types/phaser/geom/rectangle.d.ts.map +1 -0
- package/types/phaser/geom/rounded_rectangle.d.ts +12 -0
- package/types/phaser/geom/rounded_rectangle.d.ts.map +1 -0
- package/types/phaser/geom/util/circle.d.ts +55 -0
- package/types/phaser/geom/util/circle.d.ts.map +1 -0
- package/types/phaser/geom/util/ellipse.d.ts +21 -0
- package/types/phaser/geom/util/ellipse.d.ts.map +1 -0
- package/types/phaser/geom/util/line.d.ts +42 -0
- package/types/phaser/geom/util/line.d.ts.map +1 -0
- package/types/phaser/geom/util/matrix.d.ts +20 -0
- package/types/phaser/geom/util/matrix.d.ts.map +1 -0
- package/types/phaser/geom/util/point.d.ts +157 -0
- package/types/phaser/geom/util/point.d.ts.map +1 -0
- package/types/phaser/geom/util/polygon.d.ts +15 -0
- package/types/phaser/geom/util/polygon.d.ts.map +1 -0
- package/types/phaser/geom/util/rectangle.d.ts +124 -0
- package/types/phaser/geom/util/rectangle.d.ts.map +1 -0
- package/types/phaser/geom/util/rounded_rectangle.d.ts +15 -0
- package/types/phaser/geom/util/rounded_rectangle.d.ts.map +1 -0
- package/types/phaser/util/math.d.ts +162 -0
- package/types/phaser/util/math.d.ts.map +1 -0
|
@@ -38,18 +38,18 @@ export function intersectsPoints(a, b, e, f, asSegment = true, output = null) {
|
|
|
38
38
|
const a2 = f.y - e.y;
|
|
39
39
|
const b1 = a.x - b.x;
|
|
40
40
|
const b2 = e.x - f.x;
|
|
41
|
-
const c1 =
|
|
42
|
-
const c2 =
|
|
43
|
-
const denom =
|
|
41
|
+
const c1 = b.x * a.y - a.x * b.y;
|
|
42
|
+
const c2 = f.x * e.y - e.x * f.y;
|
|
43
|
+
const denom = a1 * b2 - a2 * b1;
|
|
44
44
|
if (denom === 0) {
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
|
-
result.x = (
|
|
48
|
-
result.y = (
|
|
47
|
+
result.x = (b1 * c2 - b2 * c1) / denom;
|
|
48
|
+
result.y = (a2 * c1 - a1 * c2) / denom;
|
|
49
49
|
if (asSegment) {
|
|
50
|
-
const uc = (
|
|
51
|
-
const ua = ((
|
|
52
|
-
const ub = ((
|
|
50
|
+
const uc = (f.y - e.y) * (b.x - a.x) - (f.x - e.x) * (b.y - a.y);
|
|
51
|
+
const ua = ((f.x - e.x) * (a.y - e.y) - (f.y - e.y) * (a.x - e.x)) / uc;
|
|
52
|
+
const ub = ((b.x - a.x) * (a.y - e.y) - (b.y - a.y) * (a.x - e.x)) / uc;
|
|
53
53
|
if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {
|
|
54
54
|
return result;
|
|
55
55
|
}
|
|
@@ -92,31 +92,34 @@ export function intersectsRectangle(line, rect) {
|
|
|
92
92
|
let t = 0;
|
|
93
93
|
// If the start or end of the line is inside the rect then we assume
|
|
94
94
|
// collision, as rects are solid for our use-case.
|
|
95
|
-
if (
|
|
95
|
+
if (
|
|
96
|
+
(x1 >= bx1 && x1 <= bx2 && y1 >= by1 && y1 <= by2) ||
|
|
97
|
+
(x2 >= bx1 && x2 <= bx2 && y2 >= by1 && y2 <= by2)
|
|
98
|
+
) {
|
|
96
99
|
return true;
|
|
97
100
|
}
|
|
98
101
|
if (x1 < bx1 && x2 >= bx1) {
|
|
99
102
|
// Left edge
|
|
100
|
-
t = y1 + (y2 - y1) * (bx1 - x1) / (x2 - x1);
|
|
103
|
+
t = y1 + ((y2 - y1) * (bx1 - x1)) / (x2 - x1);
|
|
101
104
|
if (t > by1 && t <= by2) {
|
|
102
105
|
return true;
|
|
103
106
|
}
|
|
104
107
|
} else if (x1 > bx2 && x2 <= bx2) {
|
|
105
108
|
// Right edge
|
|
106
|
-
t = y1 + (y2 - y1) * (bx2 - x1) / (x2 - x1);
|
|
109
|
+
t = y1 + ((y2 - y1) * (bx2 - x1)) / (x2 - x1);
|
|
107
110
|
if (t >= by1 && t <= by2) {
|
|
108
111
|
return true;
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
114
|
if (y1 < by1 && y2 >= by1) {
|
|
112
115
|
// Top edge
|
|
113
|
-
t = x1 + (x2 - x1) * (by1 - y1) / (y2 - y1);
|
|
116
|
+
t = x1 + ((x2 - x1) * (by1 - y1)) / (y2 - y1);
|
|
114
117
|
if (t >= bx1 && t <= bx2) {
|
|
115
118
|
return true;
|
|
116
119
|
}
|
|
117
120
|
} else if (y1 > by2 && y2 <= by2) {
|
|
118
121
|
// Bottom edge
|
|
119
|
-
t = x1 + (x2 - x1) * (by2 - y1) / (y2 - y1);
|
|
122
|
+
t = x1 + ((x2 - x1) * (by2 - y1)) / (y2 - y1);
|
|
120
123
|
if (t >= bx1 && t <= bx2) {
|
|
121
124
|
return true;
|
|
122
125
|
}
|
|
@@ -66,7 +66,7 @@ export function contains(a, x, y) {
|
|
|
66
66
|
if (a.width <= 0 || a.height <= 0) {
|
|
67
67
|
return false;
|
|
68
68
|
}
|
|
69
|
-
return
|
|
69
|
+
return x >= a.x && x < a.right && y >= a.y && y < a.bottom;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
@@ -80,7 +80,7 @@ export function contains(a, x, y) {
|
|
|
80
80
|
* @returns {boolean} TBD
|
|
81
81
|
*/
|
|
82
82
|
export function containsRaw(rx, ry, rw, rh, x, y) {
|
|
83
|
-
return
|
|
83
|
+
return x >= rx && x < rx + rw && y >= ry && y < ry + rh;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
@@ -103,7 +103,7 @@ export function containsRect(a, b) {
|
|
|
103
103
|
if (a.volume > b.volume) {
|
|
104
104
|
return false;
|
|
105
105
|
}
|
|
106
|
-
return
|
|
106
|
+
return a.x >= b.x && a.y >= b.y && a.right < b.right && a.bottom < b.bottom;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
@@ -113,7 +113,7 @@ export function containsRect(a, b) {
|
|
|
113
113
|
* @returns {boolean} TBD
|
|
114
114
|
*/
|
|
115
115
|
export function equals(a, b) {
|
|
116
|
-
return
|
|
116
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/**
|
|
@@ -123,7 +123,7 @@ export function equals(a, b) {
|
|
|
123
123
|
* @returns {boolean} TBD
|
|
124
124
|
*/
|
|
125
125
|
export function sameDimensions(a, b) {
|
|
126
|
-
return
|
|
126
|
+
return a.width === b.width && a.height === b.height;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
@@ -168,7 +168,12 @@ export function intersection(a, b, output = null) {
|
|
|
168
168
|
* @returns {boolean} TBD
|
|
169
169
|
*/
|
|
170
170
|
export function intersectsRaw(a, left, right, top, bottom, tolerance = 0) {
|
|
171
|
-
return !(
|
|
171
|
+
return !(
|
|
172
|
+
left > a.right + tolerance ||
|
|
173
|
+
right < a.left - tolerance ||
|
|
174
|
+
top > a.bottom + tolerance ||
|
|
175
|
+
bottom < a.top - tolerance
|
|
176
|
+
);
|
|
172
177
|
}
|
|
173
178
|
|
|
174
179
|
/**
|
|
@@ -180,7 +185,12 @@ export function intersectsRaw(a, left, right, top, bottom, tolerance = 0) {
|
|
|
180
185
|
*/
|
|
181
186
|
export function union(a, b, output = null) {
|
|
182
187
|
const result = output || new Rectangle();
|
|
183
|
-
return result.setTo(
|
|
188
|
+
return result.setTo(
|
|
189
|
+
Math.min(a.x, b.x),
|
|
190
|
+
Math.min(a.y, b.y),
|
|
191
|
+
Math.max(a.right, b.right) - Math.min(a.left, b.left),
|
|
192
|
+
Math.max(a.bottom, b.bottom) - Math.min(a.top, b.top)
|
|
193
|
+
);
|
|
184
194
|
}
|
|
185
195
|
|
|
186
196
|
/**
|
package/src/phaser/util/math.js
CHANGED
|
@@ -13,7 +13,7 @@ export const PI_2 = Math.PI * 2;
|
|
|
13
13
|
* @returns {number[]} TBD
|
|
14
14
|
*/
|
|
15
15
|
export function hex2rgb(hex) {
|
|
16
|
-
return [(hex >> 16 &
|
|
16
|
+
return [((hex >> 16) & 0xff) / 255, ((hex >> 8) & 0xff) / 255, (hex & 0xff) / 255];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -22,7 +22,7 @@ export function hex2rgb(hex) {
|
|
|
22
22
|
* @returns {number} TBD
|
|
23
23
|
*/
|
|
24
24
|
export function rgb2hex(rgb) {
|
|
25
|
-
return ((rgb[0] * 255 << 16) + (rgb[1] * 255 << 8) + rgb[2] * 255
|
|
25
|
+
return ((rgb[0] * 255) << 16) + ((rgb[1] * 255) << 8) + rgb[2] * 255;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -49,7 +49,7 @@ export function getNextPowerOfTwo(value) {
|
|
|
49
49
|
* @returns {boolean} TBD
|
|
50
50
|
*/
|
|
51
51
|
export function isPowerOfTwo(width, height) {
|
|
52
|
-
return
|
|
52
|
+
return width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
@@ -177,7 +177,7 @@ export function distance(x1, y1, x2, y2) {
|
|
|
177
177
|
* @returns {boolean} TBD
|
|
178
178
|
*/
|
|
179
179
|
export function within(a, b, tolerance) {
|
|
180
|
-
return
|
|
180
|
+
return Math.abs(a - b) <= tolerance;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
/**
|
|
@@ -189,7 +189,7 @@ export function within(a, b, tolerance) {
|
|
|
189
189
|
* @returns {number} TBD
|
|
190
190
|
*/
|
|
191
191
|
export function getColor32(a, r, g, b) {
|
|
192
|
-
return a << 24 | r << 16 | g << 8 | b;
|
|
192
|
+
return (a << 24) | (r << 16) | (g << 8) | b;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
/**
|
|
@@ -200,7 +200,7 @@ export function getColor32(a, r, g, b) {
|
|
|
200
200
|
* @returns {number} TBD
|
|
201
201
|
*/
|
|
202
202
|
export function getColor(r, g, b) {
|
|
203
|
-
return r << 16 | g << 8 | b;
|
|
203
|
+
return (r << 16) | (g << 8) | b;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
/**
|
|
@@ -210,7 +210,10 @@ export function getColor(r, g, b) {
|
|
|
210
210
|
*/
|
|
211
211
|
export function hexToColor(value, out) {
|
|
212
212
|
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
|
|
213
|
-
value = value.replace(
|
|
213
|
+
value = value.replace(
|
|
214
|
+
/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,
|
|
215
|
+
(m, r, g, b) => r + r + g + g + b + b
|
|
216
|
+
);
|
|
214
217
|
const result = /^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(value);
|
|
215
218
|
if (result) {
|
|
216
219
|
out.r = parseInt(result[1], 16);
|
|
@@ -225,7 +228,9 @@ export function hexToColor(value, out) {
|
|
|
225
228
|
* @param {object} out TBD
|
|
226
229
|
*/
|
|
227
230
|
export function webToColor(value, out) {
|
|
228
|
-
const result = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(
|
|
231
|
+
const result = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(
|
|
232
|
+
value
|
|
233
|
+
);
|
|
229
234
|
if (result) {
|
|
230
235
|
out.r = parseInt(result[1], 10);
|
|
231
236
|
out.g = parseInt(result[2], 10);
|
|
@@ -244,24 +249,24 @@ export function getRGB(color) {
|
|
|
244
249
|
// The color value has an alpha component
|
|
245
250
|
return {
|
|
246
251
|
alpha: color >>> 24,
|
|
247
|
-
red: color >> 16 &
|
|
248
|
-
green: color >> 8 &
|
|
249
|
-
blue: color &
|
|
252
|
+
red: (color >> 16) & 0xff,
|
|
253
|
+
green: (color >> 8) & 0xff,
|
|
254
|
+
blue: color & 0xff,
|
|
250
255
|
a: color >>> 24,
|
|
251
|
-
r: color >> 16 &
|
|
252
|
-
g: color >> 8 &
|
|
253
|
-
b: color &
|
|
256
|
+
r: (color >> 16) & 0xff,
|
|
257
|
+
g: (color >> 8) & 0xff,
|
|
258
|
+
b: color & 0xff,
|
|
254
259
|
};
|
|
255
260
|
}
|
|
256
261
|
return {
|
|
257
262
|
alpha: 255,
|
|
258
|
-
red: color >> 16 &
|
|
259
|
-
green: color >> 8 &
|
|
260
|
-
blue: color &
|
|
263
|
+
red: (color >> 16) & 0xff,
|
|
264
|
+
green: (color >> 8) & 0xff,
|
|
265
|
+
blue: color & 0xff,
|
|
261
266
|
a: 255,
|
|
262
|
-
r: color >> 16 &
|
|
263
|
-
g: color >> 8 &
|
|
264
|
-
b: color &
|
|
267
|
+
r: (color >> 16) & 0xff,
|
|
268
|
+
g: (color >> 8) & 0xff,
|
|
269
|
+
b: color & 0xff,
|
|
265
270
|
};
|
|
266
271
|
}
|
|
267
272
|
|
|
@@ -289,7 +294,16 @@ export function valueToColor(value, out) {
|
|
|
289
294
|
out.b = tempColor.b;
|
|
290
295
|
out.a = tempColor.a / 255;
|
|
291
296
|
}
|
|
292
|
-
out.rgba =
|
|
297
|
+
out.rgba =
|
|
298
|
+
'rgba(' +
|
|
299
|
+
out.r.toString() +
|
|
300
|
+
',' +
|
|
301
|
+
out.g.toString() +
|
|
302
|
+
',' +
|
|
303
|
+
out.b.toString() +
|
|
304
|
+
',' +
|
|
305
|
+
out.a.toString() +
|
|
306
|
+
')';
|
|
293
307
|
out.color = getColor(out.r, out.g, out.b);
|
|
294
308
|
out.color32 = getColor32(out.a * 255, out.r, out.g, out.b);
|
|
295
309
|
return out;
|
|
@@ -300,7 +314,7 @@ export function valueToColor(value, out) {
|
|
|
300
314
|
*
|
|
301
315
|
* @returns {string} TBD
|
|
302
316
|
*/
|
|
303
|
-
|
|
317
|
+
export function generateID() {
|
|
304
318
|
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
|
305
319
|
}
|
|
306
320
|
|
|
@@ -310,5 +324,5 @@ export function valueToColor(value, out) {
|
|
|
310
324
|
* @returns {string} TBD
|
|
311
325
|
*/
|
|
312
326
|
export function generateShaderID() {
|
|
313
|
-
return
|
|
327
|
+
return `${generateID()}${generateID()}-${generateID()}`.toLowerCase();
|
|
314
328
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Projects */
|
|
6
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
+
|
|
13
|
+
/* Language and Environment */
|
|
14
|
+
"target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
+
"jsx": "react" /* Specify what JSX code is generated. */,
|
|
17
|
+
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
18
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
20
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
22
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
23
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
26
|
+
|
|
27
|
+
/* Modules */
|
|
28
|
+
"module": "ESNext" /* Specify what module code is generated. */,
|
|
29
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
30
|
+
"moduleResolution": "nodenext" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
|
31
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
32
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
33
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
34
|
+
// "typeRoots": [] /* Specify multiple folders that act like './node_modules/@types'. */,
|
|
35
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
36
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
37
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
38
|
+
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
39
|
+
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
40
|
+
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
41
|
+
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
42
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
43
|
+
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
44
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
45
|
+
|
|
46
|
+
/* JavaScript Support */
|
|
47
|
+
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
|
|
48
|
+
"checkJs": true /* Enable error reporting in type-checked JavaScript files. */,
|
|
49
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
50
|
+
|
|
51
|
+
/* Emit */
|
|
52
|
+
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
|
|
53
|
+
"declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
54
|
+
"emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
55
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
56
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
57
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
58
|
+
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
59
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
60
|
+
// "noEmit": true /* Disable emitting files from a compilation. */,
|
|
61
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
62
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
63
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
64
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
65
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
66
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
67
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
68
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
69
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
70
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
71
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
72
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
73
|
+
"declarationDir": "./types" /* Specify the output directory for generated declaration files. */,
|
|
74
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
75
|
+
|
|
76
|
+
/* Interop Constraints */
|
|
77
|
+
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
|
|
78
|
+
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
79
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
80
|
+
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
81
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
82
|
+
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
83
|
+
|
|
84
|
+
/* Type Checking */
|
|
85
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
86
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
87
|
+
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
88
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
89
|
+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
90
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
91
|
+
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
92
|
+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
93
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
94
|
+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
95
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
96
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
97
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
98
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
99
|
+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
100
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
101
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
102
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
103
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
104
|
+
|
|
105
|
+
/* Completeness */
|
|
106
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
107
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
108
|
+
},
|
|
109
|
+
"include": ["./src/**/*", "./types/**/*"]
|
|
110
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as Const from './phaser/core/const';
|
|
2
|
+
import Game from './phaser/core/game';
|
|
3
|
+
import Signal from './phaser/core/signal';
|
|
4
|
+
import * as MathUtils from './phaser/util/math';
|
|
5
|
+
import BaseTexture from './phaser/display/webgl/base_texture';
|
|
6
|
+
import Texture from './phaser/display/webgl/texture';
|
|
7
|
+
import Circle from './phaser/geom/circle';
|
|
8
|
+
import Ellipse from './phaser/geom/ellipse';
|
|
9
|
+
import Line from './phaser/geom/line';
|
|
10
|
+
import Matrix from './phaser/geom/matrix';
|
|
11
|
+
import Point from './phaser/geom/point';
|
|
12
|
+
import Polygon from './phaser/geom/polygon';
|
|
13
|
+
import Rectangle from './phaser/geom/rectangle';
|
|
14
|
+
import RoundedRectangle from './phaser/geom/rounded_rectangle';
|
|
15
|
+
import BitmapText from './phaser/display/bitmap_text';
|
|
16
|
+
import Button from './phaser/display/button';
|
|
17
|
+
import DisplayObject from './phaser/display/display_object';
|
|
18
|
+
import Image from './phaser/display/image';
|
|
19
|
+
import Group from './phaser/display/group';
|
|
20
|
+
import Text from './phaser/display/text';
|
|
21
|
+
export { Const, Game, Signal, MathUtils, BaseTexture, Texture, Circle, Ellipse, Line, Matrix, Point, Polygon, Rectangle, RoundedRectangle, BitmapText, Button, DisplayObject, Image, Group, Text };
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"uBAMuB,qBAAqB;iBAC3B,oBAAoB;mBAClB,sBAAsB;2BACd,oBAAoB;wBAEvB,qCAAqC;oBACzC,gCAAgC;mBAEjC,sBAAsB;oBACrB,uBAAuB;iBAC1B,oBAAoB;mBAClB,sBAAsB;kBACvB,qBAAqB;oBACnB,uBAAuB;sBACrB,yBAAyB;6BAClB,iCAAiC;uBAEvC,8BAA8B;mBAElC,yBAAyB;0BADlB,iCAAiC;kBAEzC,wBAAwB;kBACxB,wBAAwB;iBACzB,uBAAuB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export default class _default {
|
|
2
|
+
constructor(game: any, parent: any, name: any, frameData: any, frames: any, frameRate: any, loop?: boolean);
|
|
3
|
+
game: any;
|
|
4
|
+
_parent: any;
|
|
5
|
+
_frameData: any;
|
|
6
|
+
name: any;
|
|
7
|
+
_frames: any[];
|
|
8
|
+
delay: number;
|
|
9
|
+
loop: boolean;
|
|
10
|
+
loopCount: number;
|
|
11
|
+
killOnComplete: boolean;
|
|
12
|
+
isFinished: boolean;
|
|
13
|
+
isPlaying: boolean;
|
|
14
|
+
isPaused: boolean;
|
|
15
|
+
_pauseStartTime: number;
|
|
16
|
+
_frameIndex: number;
|
|
17
|
+
_frameDiff: number;
|
|
18
|
+
_frameSkip: number;
|
|
19
|
+
currentFrame: any;
|
|
20
|
+
onStart: Signal;
|
|
21
|
+
onUpdate: Signal | null;
|
|
22
|
+
onComplete: Signal;
|
|
23
|
+
onLoop: Signal;
|
|
24
|
+
isReversed: boolean;
|
|
25
|
+
play(frameRate: any, loop: any, killOnComplete: any): default;
|
|
26
|
+
set paused(arg: boolean);
|
|
27
|
+
get paused(): boolean;
|
|
28
|
+
_timeLastFrame: any;
|
|
29
|
+
_timeNextFrame: any;
|
|
30
|
+
restart(): void;
|
|
31
|
+
reverse(): default;
|
|
32
|
+
set reversed(arg: boolean);
|
|
33
|
+
get reversed(): boolean;
|
|
34
|
+
reverseOnce(): default;
|
|
35
|
+
setFrame(frameId: any, useLocalFrameIndex?: boolean): void;
|
|
36
|
+
stop(resetFrame?: boolean, dispatchComplete?: boolean): void;
|
|
37
|
+
onPause(): void;
|
|
38
|
+
onResume(): void;
|
|
39
|
+
update(): boolean;
|
|
40
|
+
updateCurrentFrame(signalUpdate: any, fromPlay?: boolean): boolean;
|
|
41
|
+
next(quantity?: number): void;
|
|
42
|
+
previous(quantity?: number): void;
|
|
43
|
+
updateFrameData(frameData: any): void;
|
|
44
|
+
destroy(): void;
|
|
45
|
+
complete(): void;
|
|
46
|
+
get frameTotal(): number;
|
|
47
|
+
set frame(arg: any);
|
|
48
|
+
get frame(): any;
|
|
49
|
+
set speed(arg: number);
|
|
50
|
+
get speed(): number;
|
|
51
|
+
set enableUpdate(arg: boolean);
|
|
52
|
+
get enableUpdate(): boolean;
|
|
53
|
+
}
|
|
54
|
+
import Signal from './signal';
|
|
55
|
+
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../src/phaser/core/animation.js"],"names":[],"mappings":"AAOA;IACE,4GA2BC;IA1BC,UAAgB;IAChB,aAAqB;IACrB,gBAA2B;IAC3B,UAAgB;IAChB,eAAiB;IAEjB,cAA6B;IAC7B,cAAgB;IAChB,kBAAkB;IAClB,wBAA2B;IAC3B,oBAAuB;IACvB,mBAAsB;IACtB,kBAAqB;IACrB,wBAAwB;IACxB,oBAAoB;IACpB,mBAAmB;IACnB,mBAAmB;IACnB,kBAA4E;IAC5E,gBAA2B;IAC3B,wBAAoB;IACpB,mBAA8B;IAC9B,eAA0B;IAC1B,oBAAuB;IAMzB,8DA0BC;IAyOD,yBAOC;IAXD,sBAEC;IAhPC,oBAAyC;IACzC,oBAAsD;IAUxD,gBAaC;IAED,mBAGC;IAkOD,2BAEC;IAND,wBAEC;IA9ND,uBAGC;IAED,2DA2BC;IAED,6DAcC;IAED,gBAIC;IAED,iBAIC;IAED,kBAqDC;IAED,mEAiBC;IAED,8BAaC;IAED,kCAaC;IAED,sCAKC;IAED,gBAmBC;IAED,iBAWC;IAuBD,yBAEC;IASD,oBASC;IAhBD,iBAKC;IAiBD,uBAIC;IARD,oBAEC;IAYD,+BAOC;IAXD,4BAEC;CAUF;mBAhWkB,UAAU"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default class _default {
|
|
2
|
+
constructor(sprite: any);
|
|
3
|
+
sprite: any;
|
|
4
|
+
game: any;
|
|
5
|
+
currentFrame: any;
|
|
6
|
+
currentAnim: any;
|
|
7
|
+
updateIfVisible: boolean;
|
|
8
|
+
isLoaded: boolean;
|
|
9
|
+
_frameData: any;
|
|
10
|
+
_anims: {};
|
|
11
|
+
_outputFrames: any[];
|
|
12
|
+
destroy(): void;
|
|
13
|
+
loadFrameData(frameData: any, frame: any): boolean;
|
|
14
|
+
set frame(arg: any);
|
|
15
|
+
get frame(): any;
|
|
16
|
+
set frameName(arg: any);
|
|
17
|
+
get frameName(): any;
|
|
18
|
+
copyFrameData(frameData: any, frame: any): boolean;
|
|
19
|
+
add(name: any, frameList: any, frameRate?: number, loop?: boolean, useNumericIndex?: undefined): any;
|
|
20
|
+
validateFrames(frames: any, useNumericIndex?: boolean): boolean;
|
|
21
|
+
play(name: any, frameRate: any, loop: any, killOnComplete: any): any;
|
|
22
|
+
stop(name: any, resetFrame?: boolean): void;
|
|
23
|
+
update(): boolean;
|
|
24
|
+
next(quantity: any): void;
|
|
25
|
+
previous(quantity: any): void;
|
|
26
|
+
getAnimation(name: any): any;
|
|
27
|
+
refreshFrame(): void;
|
|
28
|
+
get frameData(): any;
|
|
29
|
+
get frameTotal(): any;
|
|
30
|
+
set paused(arg: any);
|
|
31
|
+
get paused(): any;
|
|
32
|
+
get name(): any;
|
|
33
|
+
_frameIndex: any;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=animation_manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation_manager.d.ts","sourceRoot":"","sources":["../../../src/phaser/core/animation_manager.js"],"names":[],"mappings":"AAOA;IACE,yBAUC;IATC,YAAoB;IACpB,UAAuB;IACvB,kBAAwB;IACxB,iBAAuB;IACvB,yBAA2B;IAC3B,kBAAqB;IACrB,gBAAsB;IACtB,WAAgB;IAChB,qBAAuB;IAGzB,gBAYC;IAED,mDAsBC;IA8JD,oBASC;IAhBD,iBAKC;IAoBD,wBAcC;IArBD,qBAKC;IA5KD,mDAmBC;IAED,qGA0BC;IAED,gEAWC;IAED,qEAkBC;IAED,4CAIC;IAED,kBASC;IAED,0BAKC;IAED,8BAKC;IAED,6BAKC;IAED,qBAIC;IAED,qBAEC;IAED,sBAEC;IAMD,qBAEC;IAND,kBAEC;IAMD,gBAKC;IAmCK,iBAA0C;CAOjD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {object} game TBD
|
|
4
|
+
* @param {object} key TBD
|
|
5
|
+
* @param {number} frameWidth TBD
|
|
6
|
+
* @param {number} frameHeight TBD
|
|
7
|
+
* @param {number} frameMax TBD
|
|
8
|
+
* @param {number} margin TBD
|
|
9
|
+
* @param {number} spacing TBD
|
|
10
|
+
* @returns {object} TBD
|
|
11
|
+
*/
|
|
12
|
+
export function spriteSheet(game: object, key: object, frameWidth: number, frameHeight: number, frameMax: number, margin: number, spacing: number): object;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {object} game TBD
|
|
16
|
+
* @param {object} json TBD
|
|
17
|
+
* @returns {object} TBD
|
|
18
|
+
*/
|
|
19
|
+
export function JSONDataHash(game: object, json: object): object;
|
|
20
|
+
//# sourceMappingURL=animation_parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation_parser.d.ts","sourceRoot":"","sources":["../../../src/phaser/core/animation_parser.js"],"names":[],"mappings":"AAQA;;;;;;;;;;GAUG;AACH,kCATW,MAAM,OACN,MAAM,cACN,MAAM,eACN,MAAM,YACN,MAAM,UACN,MAAM,WACN,MAAM,GACJ,MAAM,CA8ClB;AAED;;;;;GAKG;AACH,mCAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAwClB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Andras Csizmadia <andras@vpmedia.hu>
|
|
3
|
+
* @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
|
+
export default class _default {
|
|
7
|
+
constructor(list?: any[]);
|
|
8
|
+
position: number;
|
|
9
|
+
list: any[];
|
|
10
|
+
add(item: any): any;
|
|
11
|
+
getIndex(item: any): number;
|
|
12
|
+
getByKey(property: any, value: any): any;
|
|
13
|
+
exists(item: any): boolean;
|
|
14
|
+
reset(): void;
|
|
15
|
+
remove(item: any): any;
|
|
16
|
+
setAll(key: any, value: any): void;
|
|
17
|
+
callAll(key: any, ...args: any[]): void;
|
|
18
|
+
removeAll(destroy?: boolean): void;
|
|
19
|
+
get total(): number;
|
|
20
|
+
get first(): any;
|
|
21
|
+
get next(): any;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=array_set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array_set.d.ts","sourceRoot":"","sources":["../../../src/phaser/core/array_set.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;IACE,0BAGC;IAFC,iBAAiB;IACjB,YAAgB;IAGlB,oBAKC;IAED,4BAEC;IAED,yCASC;IAED,2BAEC;IAED,cAEC;IAED,uBAOC;IAED,mCAQC;IAED,wCAQC;IAED,mCAaC;IAED,oBAEC;IAED,iBAMC;IAED,gBAMC;CACF"}
|