@vpmedia/phaser 1.103.0 → 1.105.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/dist/index.js +997 -403
- package/dist/index.js.map +1 -1
- package/dist/phaser/core/animation.d.ts +35 -11
- package/dist/phaser/core/animation.d.ts.map +1 -1
- package/dist/phaser/core/animation_manager.d.ts +20 -10
- package/dist/phaser/core/animation_manager.d.ts.map +1 -1
- package/dist/phaser/core/animation_parser.d.ts +2 -2
- package/dist/phaser/core/animation_parser.d.ts.map +1 -1
- package/dist/phaser/core/array_set.d.ts +3 -3
- package/dist/phaser/core/array_set.d.ts.map +1 -1
- package/dist/phaser/core/cache.d.ts +68 -60
- package/dist/phaser/core/cache.d.ts.map +1 -1
- package/dist/phaser/core/device.d.ts +23 -0
- package/dist/phaser/core/device.d.ts.map +1 -1
- package/dist/phaser/core/device_util.d.ts +10 -10
- package/dist/phaser/core/device_util.d.ts.map +1 -1
- package/dist/phaser/core/dom.d.ts +6 -5
- package/dist/phaser/core/dom.d.ts.map +1 -1
- package/dist/phaser/core/event_manager.d.ts +49 -158
- package/dist/phaser/core/event_manager.d.ts.map +1 -1
- package/dist/phaser/core/factory.d.ts +8 -7
- package/dist/phaser/core/factory.d.ts.map +1 -1
- package/dist/phaser/core/frame.d.ts +27 -48
- package/dist/phaser/core/frame.d.ts.map +1 -1
- package/dist/phaser/core/frame_data.d.ts +11 -58
- package/dist/phaser/core/frame_data.d.ts.map +1 -1
- package/dist/phaser/core/frame_util.d.ts +4 -14
- package/dist/phaser/core/frame_util.d.ts.map +1 -1
- package/dist/phaser/core/game.d.ts +50 -3
- package/dist/phaser/core/game.d.ts.map +1 -1
- package/dist/phaser/core/input.d.ts +66 -13
- package/dist/phaser/core/input.d.ts.map +1 -1
- package/dist/phaser/core/input_handler.d.ts +64 -20
- package/dist/phaser/core/input_handler.d.ts.map +1 -1
- package/dist/phaser/core/input_mouse.d.ts +26 -1
- package/dist/phaser/core/input_mouse.d.ts.map +1 -1
- package/dist/phaser/core/input_mspointer.d.ts +18 -2
- package/dist/phaser/core/input_mspointer.d.ts.map +1 -1
- package/dist/phaser/core/input_pointer.d.ts +53 -9
- package/dist/phaser/core/input_pointer.d.ts.map +1 -1
- package/dist/phaser/core/input_touch.d.ts +19 -1
- package/dist/phaser/core/input_touch.d.ts.map +1 -1
- package/dist/phaser/core/loader.d.ts +56 -28
- package/dist/phaser/core/loader.d.ts.map +1 -1
- package/dist/phaser/core/loader_parser.d.ts +4 -4
- package/dist/phaser/core/loader_parser.d.ts.map +1 -1
- package/dist/phaser/core/raf.d.ts +2 -2
- package/dist/phaser/core/raf.d.ts.map +1 -1
- package/dist/phaser/core/scale_manager.d.ts +77 -17
- package/dist/phaser/core/scale_manager.d.ts.map +1 -1
- package/dist/phaser/core/scene.d.ts +3 -1
- package/dist/phaser/core/scene.d.ts.map +1 -1
- package/dist/phaser/core/scene_manager.d.ts +25 -9
- package/dist/phaser/core/scene_manager.d.ts.map +1 -1
- package/dist/phaser/core/signal.d.ts +9 -8
- package/dist/phaser/core/signal.d.ts.map +1 -1
- package/dist/phaser/core/signal_binding.d.ts +2 -2
- package/dist/phaser/core/signal_binding.d.ts.map +1 -1
- package/dist/phaser/core/sound.d.ts +58 -10
- package/dist/phaser/core/sound.d.ts.map +1 -1
- package/dist/phaser/core/sound_manager.d.ts +28 -9
- package/dist/phaser/core/sound_manager.d.ts.map +1 -1
- package/dist/phaser/core/sound_sprite.d.ts +10 -4
- package/dist/phaser/core/sound_sprite.d.ts.map +1 -1
- package/dist/phaser/core/stage.d.ts +7 -3
- package/dist/phaser/core/stage.d.ts.map +1 -1
- package/dist/phaser/core/time.d.ts +32 -5
- package/dist/phaser/core/time.d.ts.map +1 -1
- package/dist/phaser/core/timer.d.ts +30 -10
- package/dist/phaser/core/timer.d.ts.map +1 -1
- package/dist/phaser/core/timer_event.d.ts +11 -12
- package/dist/phaser/core/timer_event.d.ts.map +1 -1
- package/dist/phaser/core/tween.d.ts +38 -14
- package/dist/phaser/core/tween.d.ts.map +1 -1
- package/dist/phaser/core/tween_data.d.ts +30 -5
- package/dist/phaser/core/tween_data.d.ts.map +1 -1
- package/dist/phaser/core/tween_easing.d.ts +31 -31
- package/dist/phaser/core/tween_easing.d.ts.map +1 -1
- package/dist/phaser/core/tween_manager.d.ts +8 -4
- package/dist/phaser/core/tween_manager.d.ts.map +1 -1
- package/dist/phaser/core/world.d.ts +1 -1
- package/dist/phaser/core/world.d.ts.map +1 -1
- package/dist/phaser/display/bitmap_text.d.ts +35 -20
- package/dist/phaser/display/bitmap_text.d.ts.map +1 -1
- package/dist/phaser/display/button.d.ts +24 -8
- package/dist/phaser/display/button.d.ts.map +1 -1
- package/dist/phaser/display/canvas/buffer.d.ts +6 -2
- package/dist/phaser/display/canvas/buffer.d.ts.map +1 -1
- package/dist/phaser/display/canvas/graphics.d.ts +3 -3
- package/dist/phaser/display/canvas/graphics.d.ts.map +1 -1
- package/dist/phaser/display/canvas/masker.d.ts.map +1 -1
- package/dist/phaser/display/canvas/pool.d.ts +2 -2
- package/dist/phaser/display/canvas/pool.d.ts.map +1 -1
- package/dist/phaser/display/canvas/renderer.d.ts +18 -5
- package/dist/phaser/display/canvas/renderer.d.ts.map +1 -1
- package/dist/phaser/display/canvas/tinter.d.ts +3 -3
- package/dist/phaser/display/canvas/tinter.d.ts.map +1 -1
- package/dist/phaser/display/canvas/util.d.ts +9 -9
- package/dist/phaser/display/canvas/util.d.ts.map +1 -1
- package/dist/phaser/display/display_object.d.ts +82 -23
- package/dist/phaser/display/display_object.d.ts.map +1 -1
- package/dist/phaser/display/graphics.d.ts +42 -16
- package/dist/phaser/display/graphics.d.ts.map +1 -1
- package/dist/phaser/display/graphics_data.d.ts +11 -1
- package/dist/phaser/display/graphics_data.d.ts.map +1 -1
- package/dist/phaser/display/graphics_data_util.d.ts +1 -1
- package/dist/phaser/display/graphics_data_util.d.ts.map +1 -1
- package/dist/phaser/display/group.d.ts +24 -9
- package/dist/phaser/display/group.d.ts.map +1 -1
- package/dist/phaser/display/image.d.ts +36 -13
- package/dist/phaser/display/image.d.ts.map +1 -1
- package/dist/phaser/display/sprite_batch.d.ts +1 -1
- package/dist/phaser/display/sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/sprite_util.d.ts +5 -5
- package/dist/phaser/display/sprite_util.d.ts.map +1 -1
- package/dist/phaser/display/text.d.ts +86 -66
- package/dist/phaser/display/text.d.ts.map +1 -1
- package/dist/phaser/display/webgl/abstract_filter.d.ts +8 -1
- package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
- package/dist/phaser/display/webgl/base_texture.d.ts +14 -2
- package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/blend_manager.d.ts +5 -2
- package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/earcut.d.ts +10 -10
- package/dist/phaser/display/webgl/earcut.d.ts.map +1 -1
- package/dist/phaser/display/webgl/earcut_node.d.ts +1 -1
- package/dist/phaser/display/webgl/earcut_node.d.ts.map +1 -1
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts +17 -1
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_manager.d.ts +5 -1
- package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_texture.d.ts +7 -2
- package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/graphics.d.ts +11 -10
- package/dist/phaser/display/webgl/graphics.d.ts.map +1 -1
- package/dist/phaser/display/webgl/graphics_data.d.ts +11 -1
- package/dist/phaser/display/webgl/graphics_data.d.ts.map +1 -1
- package/dist/phaser/display/webgl/mask_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/render_texture.d.ts +12 -1
- package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/renderer.d.ts +25 -6
- package/dist/phaser/display/webgl/renderer.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/complex.d.ts +7 -1
- package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/fast.d.ts +8 -1
- package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/normal.d.ts +11 -0
- package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/primitive.d.ts +7 -1
- package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/strip.d.ts +7 -1
- package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader_manager.d.ts +14 -2
- package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/sprite_batch.d.ts +19 -2
- package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/stencil_manager.d.ts +8 -4
- package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/texture.d.ts +35 -2
- package/dist/phaser/display/webgl/texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/texture_util.d.ts +2 -2
- package/dist/phaser/display/webgl/texture_util.d.ts.map +1 -1
- package/dist/phaser/display/webgl/util.d.ts +6 -6
- package/dist/phaser/display/webgl/util.d.ts.map +1 -1
- package/dist/phaser/geom/circle.d.ts +11 -10
- package/dist/phaser/geom/circle.d.ts.map +1 -1
- package/dist/phaser/geom/ellipse.d.ts +6 -5
- package/dist/phaser/geom/ellipse.d.ts.map +1 -1
- package/dist/phaser/geom/line.d.ts +14 -14
- package/dist/phaser/geom/line.d.ts.map +1 -1
- package/dist/phaser/geom/matrix.d.ts +13 -12
- package/dist/phaser/geom/matrix.d.ts.map +1 -1
- package/dist/phaser/geom/point.d.ts +19 -19
- package/dist/phaser/geom/point.d.ts.map +1 -1
- package/dist/phaser/geom/polygon.d.ts +6 -6
- package/dist/phaser/geom/polygon.d.ts.map +1 -1
- package/dist/phaser/geom/rectangle.d.ts +20 -20
- package/dist/phaser/geom/rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/rounded_rectangle.d.ts +2 -2
- package/dist/phaser/geom/rounded_rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/util/circle.d.ts +9 -7
- package/dist/phaser/geom/util/circle.d.ts.map +1 -1
- package/dist/phaser/geom/util/ellipse.d.ts +1 -1
- package/dist/phaser/geom/util/ellipse.d.ts.map +1 -1
- package/dist/phaser/geom/util/line.d.ts +5 -3
- package/dist/phaser/geom/util/line.d.ts.map +1 -1
- package/dist/phaser/geom/util/matrix.d.ts +2 -1
- package/dist/phaser/geom/util/matrix.d.ts.map +1 -1
- package/dist/phaser/geom/util/point.d.ts +19 -19
- package/dist/phaser/geom/util/point.d.ts.map +1 -1
- package/dist/phaser/geom/util/polygon.d.ts +2 -1
- package/dist/phaser/geom/util/polygon.d.ts.map +1 -1
- package/dist/phaser/geom/util/rectangle.d.ts +17 -15
- package/dist/phaser/geom/util/rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/util/rounded_rectangle.d.ts +2 -1
- package/dist/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
- package/dist/phaser/util/math.d.ts +51 -142
- package/dist/phaser/util/math.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/phaser/core/animation.ts +41 -18
- package/src/phaser/core/animation_manager.ts +21 -12
- package/src/phaser/core/animation_parser.ts +11 -3
- package/src/phaser/core/array_set.ts +8 -8
- package/src/phaser/core/cache.ts +75 -60
- package/src/phaser/core/device.ts +23 -1
- package/src/phaser/core/device_util.ts +10 -10
- package/src/phaser/core/dom.ts +5 -5
- package/src/phaser/core/event_manager.ts +52 -177
- package/src/phaser/core/factory.ts +25 -17
- package/src/phaser/core/frame.ts +37 -51
- package/src/phaser/core/frame_data.ts +29 -74
- package/src/phaser/core/frame_util.ts +3 -16
- package/src/phaser/core/game.ts +40 -11
- package/src/phaser/core/input.ts +68 -17
- package/src/phaser/core/input_handler.ts +81 -45
- package/src/phaser/core/input_mouse.ts +42 -13
- package/src/phaser/core/input_mspointer.ts +24 -9
- package/src/phaser/core/input_pointer.ts +55 -12
- package/src/phaser/core/input_touch.ts +26 -9
- package/src/phaser/core/loader.ts +97 -42
- package/src/phaser/core/loader_parser.ts +6 -7
- package/src/phaser/core/raf.ts +2 -2
- package/src/phaser/core/scale_manager.ts +85 -27
- package/src/phaser/core/scene.ts +3 -2
- package/src/phaser/core/scene_manager.ts +26 -11
- package/src/phaser/core/signal.ts +10 -10
- package/src/phaser/core/signal_binding.ts +2 -2
- package/src/phaser/core/sound.ts +72 -26
- package/src/phaser/core/sound_manager.ts +31 -13
- package/src/phaser/core/sound_sprite.ts +10 -5
- package/src/phaser/core/stage.ts +8 -4
- package/src/phaser/core/time.ts +33 -7
- package/src/phaser/core/timer.ts +40 -14
- package/src/phaser/core/timer_event.ts +23 -14
- package/src/phaser/core/tween.ts +43 -23
- package/src/phaser/core/tween_data.ts +31 -7
- package/src/phaser/core/tween_easing.ts +31 -31
- package/src/phaser/core/tween_manager.ts +10 -7
- package/src/phaser/core/world.ts +1 -2
- package/src/phaser/display/bitmap_text.ts +41 -18
- package/src/phaser/display/button.ts +24 -23
- package/src/phaser/display/canvas/buffer.ts +6 -3
- package/src/phaser/display/canvas/graphics.ts +3 -4
- package/src/phaser/display/canvas/masker.ts +2 -3
- package/src/phaser/display/canvas/pool.ts +3 -4
- package/src/phaser/display/canvas/renderer.ts +19 -7
- package/src/phaser/display/canvas/tinter.ts +4 -5
- package/src/phaser/display/canvas/util.ts +9 -9
- package/src/phaser/display/display_object.ts +120 -61
- package/src/phaser/display/graphics.ts +56 -25
- package/src/phaser/display/graphics_data.ts +11 -2
- package/src/phaser/display/graphics_data_util.ts +1 -2
- package/src/phaser/display/group.ts +32 -14
- package/src/phaser/display/image.ts +37 -19
- package/src/phaser/display/sprite_batch.ts +1 -2
- package/src/phaser/display/sprite_util.ts +5 -6
- package/src/phaser/display/text.ts +82 -56
- package/src/phaser/display/webgl/abstract_filter.ts +8 -2
- package/src/phaser/display/webgl/base_texture.ts +14 -3
- package/src/phaser/display/webgl/blend_manager.ts +5 -3
- package/src/phaser/display/webgl/earcut.ts +27 -27
- package/src/phaser/display/webgl/earcut_node.ts +1 -1
- package/src/phaser/display/webgl/fast_sprite_batch.ts +19 -4
- package/src/phaser/display/webgl/filter_manager.ts +5 -2
- package/src/phaser/display/webgl/filter_texture.ts +7 -3
- package/src/phaser/display/webgl/graphics.ts +10 -11
- package/src/phaser/display/webgl/graphics_data.ts +11 -2
- package/src/phaser/display/webgl/mask_manager.ts +2 -3
- package/src/phaser/display/webgl/render_texture.ts +12 -2
- package/src/phaser/display/webgl/renderer.ts +24 -7
- package/src/phaser/display/webgl/shader/complex.ts +7 -2
- package/src/phaser/display/webgl/shader/fast.ts +8 -2
- package/src/phaser/display/webgl/shader/normal.ts +12 -2
- package/src/phaser/display/webgl/shader/primitive.ts +7 -2
- package/src/phaser/display/webgl/shader/strip.ts +7 -2
- package/src/phaser/display/webgl/shader_manager.ts +13 -3
- package/src/phaser/display/webgl/sprite_batch.ts +20 -4
- package/src/phaser/display/webgl/stencil_manager.ts +8 -5
- package/src/phaser/display/webgl/texture.ts +35 -4
- package/src/phaser/display/webgl/texture_util.ts +2 -3
- package/src/phaser/display/webgl/util.ts +6 -6
- package/src/phaser/geom/circle.ts +10 -10
- package/src/phaser/geom/ellipse.ts +6 -6
- package/src/phaser/geom/line.ts +14 -14
- package/src/phaser/geom/matrix.ts +12 -12
- package/src/phaser/geom/point.ts +19 -19
- package/src/phaser/geom/polygon.ts +5 -5
- package/src/phaser/geom/rectangle.ts +21 -21
- package/src/phaser/geom/rounded_rectangle.ts +2 -2
- package/src/phaser/geom/util/circle.ts +7 -7
- package/src/phaser/geom/util/ellipse.ts +1 -1
- package/src/phaser/geom/util/line.ts +5 -5
- package/src/phaser/geom/util/matrix.ts +1 -1
- package/src/phaser/geom/util/point.ts +20 -20
- package/src/phaser/geom/util/polygon.ts +1 -1
- package/src/phaser/geom/util/rectangle.ts +15 -15
- package/src/phaser/geom/util/rounded_rectangle.ts +1 -1
- package/src/phaser/util/math.ts +65 -151
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DisplayObject } from '../display/display_object.js';
|
|
2
2
|
import { Signal } from './signal.js';
|
|
3
3
|
|
|
4
4
|
export class EventManager {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
parent: DisplayObject | null;
|
|
6
|
+
_onAddedToGroup: Signal | null;
|
|
7
|
+
_onRemovedFromGroup: Signal | null;
|
|
8
|
+
_onDestroy: Signal | null;
|
|
9
|
+
_onOutOfBounds: Signal | null;
|
|
10
|
+
_onEnterBounds: Signal | null;
|
|
11
|
+
_onInputOver: Signal | null;
|
|
12
|
+
_onInputOut: Signal | null;
|
|
13
|
+
_onInputDown: Signal | null;
|
|
14
|
+
_onInputUp: Signal | null;
|
|
15
|
+
_onDragStart: Signal | null;
|
|
16
|
+
_onDragUpdate: Signal | null;
|
|
17
|
+
_onDragStop: Signal | null;
|
|
18
|
+
_onAnimationStart: Signal | null;
|
|
19
|
+
_onAnimationComplete: Signal | null;
|
|
20
|
+
_onAnimationLoop: Signal | null;
|
|
21
|
+
|
|
22
|
+
constructor(sprite: DisplayObject) {
|
|
10
23
|
this.parent = sprite;
|
|
11
24
|
this._onAddedToGroup = null;
|
|
12
25
|
this._onRemovedFromGroup = null;
|
|
@@ -25,11 +38,8 @@ export class EventManager {
|
|
|
25
38
|
this._onAnimationLoop = null;
|
|
26
39
|
}
|
|
27
40
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*/
|
|
31
|
-
destroy() {
|
|
32
|
-
this._parent = null;
|
|
41
|
+
destroy(): void {
|
|
42
|
+
this.parent = null;
|
|
33
43
|
if (this._onDestroy) {
|
|
34
44
|
this._onDestroy.dispose();
|
|
35
45
|
}
|
|
@@ -77,318 +87,183 @@ export class EventManager {
|
|
|
77
87
|
}
|
|
78
88
|
}
|
|
79
89
|
|
|
80
|
-
|
|
81
|
-
* Gets the onAddedToGroup signal.
|
|
82
|
-
* @returns {Signal} The Signal object for the onAddedToGroup event.
|
|
83
|
-
*/
|
|
84
|
-
get onAddedToGroup() {
|
|
90
|
+
get onAddedToGroup(): Signal {
|
|
85
91
|
if (!this._onAddedToGroup) {
|
|
86
92
|
this._onAddedToGroup = new Signal();
|
|
87
93
|
}
|
|
88
94
|
return this._onAddedToGroup;
|
|
89
95
|
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Dispatches the onAddedToGroup event.
|
|
93
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
94
|
-
*/
|
|
95
|
-
onAddedToGroup$dispatch(...args) {
|
|
96
|
+
onAddedToGroup$dispatch(...args: unknown[]): void {
|
|
96
97
|
if (this._onAddedToGroup) {
|
|
97
98
|
this._onAddedToGroup.dispatch(...args);
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
* Gets the onRemovedFromGroup signal.
|
|
103
|
-
* @returns {Signal} The Signal object for the onRemovedFromGroup event.
|
|
104
|
-
*/
|
|
105
|
-
get onRemovedFromGroup() {
|
|
102
|
+
get onRemovedFromGroup(): Signal {
|
|
106
103
|
if (!this._onRemovedFromGroup) {
|
|
107
104
|
this._onRemovedFromGroup = new Signal();
|
|
108
105
|
}
|
|
109
106
|
return this._onRemovedFromGroup;
|
|
110
107
|
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Dispatches the onRemovedFromGroup event.
|
|
114
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
115
|
-
*/
|
|
116
|
-
onRemovedFromGroup$dispatch(...args) {
|
|
108
|
+
onRemovedFromGroup$dispatch(...args: unknown[]): void {
|
|
117
109
|
if (this._onRemovedFromGroup) {
|
|
118
110
|
this._onRemovedFromGroup.dispatch(...args);
|
|
119
111
|
}
|
|
120
112
|
}
|
|
121
113
|
|
|
122
|
-
|
|
123
|
-
* Gets the onDestroy signal.
|
|
124
|
-
* @returns {Signal} The Signal object for the onDestroy event.
|
|
125
|
-
*/
|
|
126
|
-
get onDestroy() {
|
|
114
|
+
get onDestroy(): Signal {
|
|
127
115
|
if (!this._onDestroy) {
|
|
128
116
|
this._onDestroy = new Signal();
|
|
129
117
|
}
|
|
130
118
|
return this._onDestroy;
|
|
131
119
|
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Dispatches the onDestroy event.
|
|
135
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
136
|
-
*/
|
|
137
|
-
onDestroy$dispatch(...args) {
|
|
120
|
+
onDestroy$dispatch(...args: unknown[]): void {
|
|
138
121
|
if (this._onDestroy) {
|
|
139
122
|
this._onDestroy.dispatch(...args);
|
|
140
123
|
}
|
|
141
124
|
}
|
|
142
125
|
|
|
143
|
-
|
|
144
|
-
* Gets the onOutOfBounds signal.
|
|
145
|
-
* @returns {Signal} The Signal object for the onOutOfBounds event.
|
|
146
|
-
*/
|
|
147
|
-
get onOutOfBounds() {
|
|
126
|
+
get onOutOfBounds(): Signal {
|
|
148
127
|
if (!this._onOutOfBounds) {
|
|
149
128
|
this._onOutOfBounds = new Signal();
|
|
150
129
|
}
|
|
151
130
|
return this._onOutOfBounds;
|
|
152
131
|
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Dispatches the onOutOfBounds event.
|
|
156
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
157
|
-
*/
|
|
158
|
-
onOutOfBounds$dispatch(...args) {
|
|
132
|
+
onOutOfBounds$dispatch(...args: unknown[]): void {
|
|
159
133
|
if (this._onOutOfBounds) {
|
|
160
134
|
this._onOutOfBounds.dispatch(...args);
|
|
161
135
|
}
|
|
162
136
|
}
|
|
163
137
|
|
|
164
|
-
|
|
165
|
-
* Gets the onEnterBounds signal.
|
|
166
|
-
* @returns {Signal} The Signal object for the onEnterBounds event.
|
|
167
|
-
*/
|
|
168
|
-
get onEnterBounds() {
|
|
138
|
+
get onEnterBounds(): Signal {
|
|
169
139
|
if (!this._onEnterBounds) {
|
|
170
140
|
this._onEnterBounds = new Signal();
|
|
171
141
|
}
|
|
172
142
|
return this._onEnterBounds;
|
|
173
143
|
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Dispatches the onEnterBounds event.
|
|
177
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
178
|
-
*/
|
|
179
|
-
onEnterBounds$dispatch(...args) {
|
|
144
|
+
onEnterBounds$dispatch(...args: unknown[]): void {
|
|
180
145
|
if (this._onEnterBounds) {
|
|
181
146
|
this._onEnterBounds.dispatch(...args);
|
|
182
147
|
}
|
|
183
148
|
}
|
|
184
149
|
|
|
185
|
-
|
|
186
|
-
* Gets the onInputOver signal.
|
|
187
|
-
* @returns {Signal} The Signal object for the onInputOver event.
|
|
188
|
-
*/
|
|
189
|
-
get onInputOver() {
|
|
150
|
+
get onInputOver(): Signal {
|
|
190
151
|
if (!this._onInputOver) {
|
|
191
152
|
this._onInputOver = new Signal();
|
|
192
153
|
}
|
|
193
154
|
return this._onInputOver;
|
|
194
155
|
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Dispatches the onInputOver event.
|
|
198
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
199
|
-
*/
|
|
200
|
-
onInputOver$dispatch(...args) {
|
|
156
|
+
onInputOver$dispatch(...args: unknown[]): void {
|
|
201
157
|
if (this._onInputOver) {
|
|
202
158
|
this._onInputOver.dispatch(...args);
|
|
203
159
|
}
|
|
204
160
|
}
|
|
205
161
|
|
|
206
|
-
|
|
207
|
-
* Gets the onInputOut signal.
|
|
208
|
-
* @returns {Signal} The Signal object for the onInputOut event.
|
|
209
|
-
*/
|
|
210
|
-
get onInputOut() {
|
|
162
|
+
get onInputOut(): Signal {
|
|
211
163
|
if (!this._onInputOut) {
|
|
212
164
|
this._onInputOut = new Signal();
|
|
213
165
|
}
|
|
214
166
|
return this._onInputOut;
|
|
215
167
|
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Dispatches the onInputOut event.
|
|
219
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
220
|
-
*/
|
|
221
|
-
onInputOut$dispatch(...args) {
|
|
168
|
+
onInputOut$dispatch(...args: unknown[]): void {
|
|
222
169
|
if (this._onInputOut) {
|
|
223
170
|
this._onInputOut.dispatch(...args);
|
|
224
171
|
}
|
|
225
172
|
}
|
|
226
173
|
|
|
227
|
-
|
|
228
|
-
* Gets the onInputDown signal.
|
|
229
|
-
* @returns {Signal} The Signal object for the onInputDown event.
|
|
230
|
-
*/
|
|
231
|
-
get onInputDown() {
|
|
174
|
+
get onInputDown(): Signal {
|
|
232
175
|
if (!this._onInputDown) {
|
|
233
176
|
this._onInputDown = new Signal();
|
|
234
177
|
}
|
|
235
178
|
return this._onInputDown;
|
|
236
179
|
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Dispatches the onInputDown event.
|
|
240
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
241
|
-
*/
|
|
242
|
-
onInputDown$dispatch(...args) {
|
|
180
|
+
onInputDown$dispatch(...args: unknown[]): void {
|
|
243
181
|
if (this._onInputDown) {
|
|
244
182
|
this._onInputDown.dispatch(...args);
|
|
245
183
|
}
|
|
246
184
|
}
|
|
247
185
|
|
|
248
|
-
|
|
249
|
-
* Gets the onInputUp signal.
|
|
250
|
-
* @returns {Signal} The Signal object for the onInputUp event.
|
|
251
|
-
*/
|
|
252
|
-
get onInputUp() {
|
|
186
|
+
get onInputUp(): Signal {
|
|
253
187
|
if (!this._onInputUp) {
|
|
254
188
|
this._onInputUp = new Signal();
|
|
255
189
|
}
|
|
256
190
|
return this._onInputUp;
|
|
257
191
|
}
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Dispatches the onInputUp event.
|
|
261
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
262
|
-
*/
|
|
263
|
-
onInputUp$dispatch(...args) {
|
|
192
|
+
onInputUp$dispatch(...args: unknown[]): void {
|
|
264
193
|
if (this._onInputUp) {
|
|
265
194
|
this._onInputUp.dispatch(...args);
|
|
266
195
|
}
|
|
267
196
|
}
|
|
268
197
|
|
|
269
|
-
|
|
270
|
-
* Gets the onDragStart signal.
|
|
271
|
-
* @returns {Signal} The Signal object for the onDragStart event.
|
|
272
|
-
*/
|
|
273
|
-
get onDragStart() {
|
|
198
|
+
get onDragStart(): Signal {
|
|
274
199
|
if (!this._onDragStart) {
|
|
275
200
|
this._onDragStart = new Signal();
|
|
276
201
|
}
|
|
277
202
|
return this._onDragStart;
|
|
278
203
|
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Dispatches the onDragStart event.
|
|
282
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
283
|
-
*/
|
|
284
|
-
onDragStart$dispatch(...args) {
|
|
204
|
+
onDragStart$dispatch(...args: unknown[]): void {
|
|
285
205
|
if (this._onDragStart) {
|
|
286
206
|
this._onDragStart.dispatch(...args);
|
|
287
207
|
}
|
|
288
208
|
}
|
|
289
209
|
|
|
290
|
-
|
|
291
|
-
* Gets the onDragUpdate signal.
|
|
292
|
-
* @returns {Signal} The Signal object for the onDragUpdate event.
|
|
293
|
-
*/
|
|
294
|
-
get onDragUpdate() {
|
|
210
|
+
get onDragUpdate(): Signal {
|
|
295
211
|
if (!this._onDragUpdate) {
|
|
296
212
|
this._onDragUpdate = new Signal();
|
|
297
213
|
}
|
|
298
214
|
return this._onDragUpdate;
|
|
299
215
|
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Dispatches the onDragUpdate event.
|
|
303
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
304
|
-
*/
|
|
305
|
-
onDragUpdate$dispatch(...args) {
|
|
216
|
+
onDragUpdate$dispatch(...args: unknown[]): void {
|
|
306
217
|
if (this._onDragUpdate) {
|
|
307
218
|
this._onDragUpdate.dispatch(...args);
|
|
308
219
|
}
|
|
309
220
|
}
|
|
310
221
|
|
|
311
|
-
|
|
312
|
-
* Gets the onDragStop signal.
|
|
313
|
-
* @returns {Signal} The Signal object for the onDragStop event.
|
|
314
|
-
*/
|
|
315
|
-
get onDragStop() {
|
|
222
|
+
get onDragStop(): Signal {
|
|
316
223
|
if (!this._onDragStop) {
|
|
317
224
|
this._onDragStop = new Signal();
|
|
318
225
|
}
|
|
319
226
|
return this._onDragStop;
|
|
320
227
|
}
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Dispatches the onDragStop event.
|
|
324
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
325
|
-
*/
|
|
326
|
-
onDragStop$dispatch(...args) {
|
|
228
|
+
onDragStop$dispatch(...args: unknown[]): void {
|
|
327
229
|
if (this._onDragStop) {
|
|
328
230
|
this._onDragStop.dispatch(...args);
|
|
329
231
|
}
|
|
330
232
|
}
|
|
331
233
|
|
|
332
|
-
|
|
333
|
-
* Gets the onAnimationStart signal.
|
|
334
|
-
* @returns {Signal} The Signal object for the onAnimationStart event.
|
|
335
|
-
*/
|
|
336
|
-
get onAnimationStart() {
|
|
234
|
+
get onAnimationStart(): Signal {
|
|
337
235
|
if (!this._onAnimationStart) {
|
|
338
236
|
this._onAnimationStart = new Signal();
|
|
339
237
|
}
|
|
340
238
|
return this._onAnimationStart;
|
|
341
239
|
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Dispatches the onAnimationStart event.
|
|
345
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
346
|
-
*/
|
|
347
|
-
onAnimationStart$dispatch(...args) {
|
|
240
|
+
onAnimationStart$dispatch(...args: unknown[]): void {
|
|
348
241
|
if (this._onAnimationStart) {
|
|
349
242
|
this._onAnimationStart.dispatch(...args);
|
|
350
243
|
}
|
|
351
244
|
}
|
|
352
245
|
|
|
353
|
-
|
|
354
|
-
* Gets the onAnimationComplete signal.
|
|
355
|
-
* @returns {Signal} The Signal object for the onAnimationComplete event.
|
|
356
|
-
*/
|
|
357
|
-
get onAnimationComplete() {
|
|
246
|
+
get onAnimationComplete(): Signal {
|
|
358
247
|
if (!this._onAnimationComplete) {
|
|
359
248
|
this._onAnimationComplete = new Signal();
|
|
360
249
|
}
|
|
361
250
|
return this._onAnimationComplete;
|
|
362
251
|
}
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Dispatches the onAnimationComplete event.
|
|
366
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
367
|
-
*/
|
|
368
|
-
onAnimationComplete$dispatch(...args) {
|
|
252
|
+
onAnimationComplete$dispatch(...args: unknown[]): void {
|
|
369
253
|
if (this._onAnimationComplete) {
|
|
370
254
|
this._onAnimationComplete.dispatch(...args);
|
|
371
255
|
}
|
|
372
256
|
}
|
|
373
257
|
|
|
374
|
-
|
|
375
|
-
* Gets the onAnimationLoop signal.
|
|
376
|
-
* @returns {Signal} The Signal object for the onAnimationLoop event.
|
|
377
|
-
*/
|
|
378
|
-
get onAnimationLoop() {
|
|
258
|
+
get onAnimationLoop(): Signal {
|
|
379
259
|
if (!this._onAnimationLoop) {
|
|
380
260
|
this._onAnimationLoop = new Signal();
|
|
381
261
|
}
|
|
382
262
|
return this._onAnimationLoop;
|
|
383
263
|
}
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Dispatches the onAnimationLoop event.
|
|
387
|
-
* @param {...any} args - Arguments to pass to the signal.
|
|
388
|
-
*/
|
|
389
|
-
onAnimationLoop$dispatch(...args) {
|
|
264
|
+
onAnimationLoop$dispatch(...args: unknown[]): void {
|
|
390
265
|
if (this._onAnimationLoop) {
|
|
391
266
|
this._onAnimationLoop.dispatch(...args);
|
|
392
267
|
}
|
|
393
268
|
}
|
|
394
|
-
}
|
|
269
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import { BitmapText } from '../display/bitmap_text.js';
|
|
3
2
|
import { Button } from '../display/button.js';
|
|
4
3
|
import { Graphics } from '../display/graphics.js';
|
|
@@ -7,11 +6,12 @@ import { Image } from '../display/image.js';
|
|
|
7
6
|
import { Text } from '../display/text.js';
|
|
8
7
|
|
|
9
8
|
export class GameObjectFactory {
|
|
9
|
+
game!: any;
|
|
10
10
|
/**
|
|
11
11
|
* Creates a new GameObjectFactory instance.
|
|
12
12
|
* @param {import('./game.js').Game} game - The game instance this factory belongs to.
|
|
13
13
|
*/
|
|
14
|
-
constructor(game) {
|
|
14
|
+
constructor(game: import('./game.js').Game) {
|
|
15
15
|
this.game = game;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -24,7 +24,7 @@ export class GameObjectFactory {
|
|
|
24
24
|
* @param {Group} group - The parent group for the image.
|
|
25
25
|
* @returns {Image} The created Image object.
|
|
26
26
|
*/
|
|
27
|
-
image(x, y, key, frame, group = null) {
|
|
27
|
+
image(x: number, y: number, key: string, frame: any, group: Group = null) {
|
|
28
28
|
if (!group) {
|
|
29
29
|
group = this.game.world;
|
|
30
30
|
}
|
|
@@ -38,7 +38,7 @@ export class GameObjectFactory {
|
|
|
38
38
|
* @param {boolean} addToStage - Whether to add the group to the stage.
|
|
39
39
|
* @returns {Group} The created Group object.
|
|
40
40
|
*/
|
|
41
|
-
group(parent = null, name = null, addToStage = false) {
|
|
41
|
+
group(parent: Group | null = null, name: string | null = null, addToStage: boolean = false) {
|
|
42
42
|
return new Group(this.game, parent, name, addToStage);
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -51,7 +51,7 @@ export class GameObjectFactory {
|
|
|
51
51
|
* @param {Group | null} group - The parent group for the text.
|
|
52
52
|
* @returns {Text} The created Text object.
|
|
53
53
|
*/
|
|
54
|
-
text(x, y, text, style, group = null) {
|
|
54
|
+
text(x: number, y: number, text: any, style: any, group: Group | null = null) {
|
|
55
55
|
const parent = group || this.game.world;
|
|
56
56
|
return parent.add(new Text(this.game, x, y, text, style));
|
|
57
57
|
}
|
|
@@ -71,16 +71,16 @@ export class GameObjectFactory {
|
|
|
71
71
|
* @returns {Button} The created Button object.
|
|
72
72
|
*/
|
|
73
73
|
button(
|
|
74
|
-
x,
|
|
75
|
-
y,
|
|
76
|
-
key,
|
|
77
|
-
callback = null,
|
|
78
|
-
callbackContext = null,
|
|
79
|
-
overFrame = null,
|
|
80
|
-
outFrame = null,
|
|
81
|
-
downFrame = null,
|
|
82
|
-
upFrame = null,
|
|
83
|
-
group = null
|
|
74
|
+
x: number,
|
|
75
|
+
y: number,
|
|
76
|
+
key: string,
|
|
77
|
+
callback: Function | null = null,
|
|
78
|
+
callbackContext: any | null = null,
|
|
79
|
+
overFrame: string | null = null,
|
|
80
|
+
outFrame: string | null = null,
|
|
81
|
+
downFrame: string | null = null,
|
|
82
|
+
upFrame: string | null = null,
|
|
83
|
+
group: Group | null = null
|
|
84
84
|
) {
|
|
85
85
|
const parent = group || this.game.world;
|
|
86
86
|
return parent.add(
|
|
@@ -95,7 +95,7 @@ export class GameObjectFactory {
|
|
|
95
95
|
* @param {Group | null} group - The parent group for the graphics object.
|
|
96
96
|
* @returns {Graphics} The created Graphics object.
|
|
97
97
|
*/
|
|
98
|
-
graphics(x = 0, y = 0, group = null) {
|
|
98
|
+
graphics(x: number = 0, y: number = 0, group: Group | null = null) {
|
|
99
99
|
const parent = group || this.game.world;
|
|
100
100
|
return parent.add(new Graphics(this.game, x, y));
|
|
101
101
|
}
|
|
@@ -111,7 +111,15 @@ export class GameObjectFactory {
|
|
|
111
111
|
* @param {string} align - The alignment of the text.
|
|
112
112
|
* @returns {BitmapText} The created BitmapText object.
|
|
113
113
|
*/
|
|
114
|
-
bitmapText(
|
|
114
|
+
bitmapText(
|
|
115
|
+
x: number,
|
|
116
|
+
y: number,
|
|
117
|
+
font: string,
|
|
118
|
+
text: string,
|
|
119
|
+
size: number,
|
|
120
|
+
group: Group | null = null,
|
|
121
|
+
align: string = 'left'
|
|
122
|
+
) {
|
|
115
123
|
const parent = group || this.game.world;
|
|
116
124
|
return parent.add(new BitmapText(this.game, x, y, font, text, size, align));
|
|
117
125
|
}
|
package/src/phaser/core/frame.ts
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import { Rectangle } from '../geom/rectangle.js';
|
|
3
2
|
import { distance } from '../util/math.js';
|
|
4
3
|
import { cloneFrame } from './frame_util.js';
|
|
5
4
|
|
|
6
5
|
export class Frame {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
index!: number;
|
|
7
|
+
x!: number;
|
|
8
|
+
y!: number;
|
|
9
|
+
width!: number;
|
|
10
|
+
height!: number;
|
|
11
|
+
name!: string;
|
|
12
|
+
centerX!: number;
|
|
13
|
+
centerY!: number;
|
|
14
|
+
distance!: number;
|
|
15
|
+
rotated!: boolean;
|
|
16
|
+
rotationDirection!: 'cw' | 'ccw';
|
|
17
|
+
trimmed!: boolean;
|
|
18
|
+
sourceSizeW!: number;
|
|
19
|
+
sourceSizeH!: number;
|
|
20
|
+
spriteSourceSizeX!: number;
|
|
21
|
+
spriteSourceSizeY!: number;
|
|
22
|
+
spriteSourceSizeW!: number;
|
|
23
|
+
spriteSourceSizeH!: number;
|
|
24
|
+
right!: number;
|
|
25
|
+
bottom!: number;
|
|
26
|
+
|
|
27
|
+
constructor(index: number, x: number, y: number, width: number, height: number, name?: string) {
|
|
17
28
|
this.initialize(index, x, y, width, height, name);
|
|
18
29
|
}
|
|
19
30
|
|
|
20
|
-
|
|
21
|
-
* Initializes this frame with the specified properties.
|
|
22
|
-
* @param {number} index - The index of this frame in the animation.
|
|
23
|
-
* @param {number} x - The x coordinate of this frame's position in the texture.
|
|
24
|
-
* @param {number} y - The y coordinate of this frame's position in the texture.
|
|
25
|
-
* @param {number} width - The width of this frame in pixels.
|
|
26
|
-
* @param {number} height - The height of this frame in pixels.
|
|
27
|
-
* @param {string} name - The name of this frame.
|
|
28
|
-
*/
|
|
29
|
-
initialize(index, x, y, width, height, name) {
|
|
31
|
+
initialize(index: number, x: number, y: number, width: number, height: number, name?: string): void {
|
|
30
32
|
this.index = index;
|
|
31
33
|
this.x = x;
|
|
32
34
|
this.y = y;
|
|
33
35
|
this.width = width;
|
|
34
36
|
this.height = height;
|
|
35
|
-
this.name = name;
|
|
37
|
+
this.name = name as string;
|
|
36
38
|
this.centerX = Math.floor(width / 2);
|
|
37
39
|
this.centerY = Math.floor(height / 2);
|
|
38
40
|
this.distance = distance(0, 0, width, height);
|
|
@@ -49,12 +51,7 @@ export class Frame {
|
|
|
49
51
|
this.bottom = this.y + this.height;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
* Resizes this frame to the specified dimensions.
|
|
54
|
-
* @param {number} width - The new width of this frame in pixels.
|
|
55
|
-
* @param {number} height - The new height of this frame in pixels.
|
|
56
|
-
*/
|
|
57
|
-
resize(width, height) {
|
|
54
|
+
resize(width: number, height: number): void {
|
|
58
55
|
this.width = width;
|
|
59
56
|
this.height = height;
|
|
60
57
|
this.centerX = Math.floor(width / 2);
|
|
@@ -66,17 +63,15 @@ export class Frame {
|
|
|
66
63
|
this.bottom = this.y + height;
|
|
67
64
|
}
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
*/
|
|
79
|
-
setTrim(trimmed, actualWidth, actualHeight, destX, destY, destWidth, destHeight) {
|
|
66
|
+
setTrim(
|
|
67
|
+
trimmed: boolean,
|
|
68
|
+
actualWidth: number,
|
|
69
|
+
actualHeight: number,
|
|
70
|
+
destX: number,
|
|
71
|
+
destY: number,
|
|
72
|
+
destWidth: number,
|
|
73
|
+
destHeight: number
|
|
74
|
+
): void {
|
|
80
75
|
this.trimmed = trimmed;
|
|
81
76
|
if (trimmed) {
|
|
82
77
|
this.sourceSizeW = actualWidth;
|
|
@@ -90,22 +85,13 @@ export class Frame {
|
|
|
90
85
|
}
|
|
91
86
|
}
|
|
92
87
|
|
|
93
|
-
|
|
94
|
-
* Creates a clone of this frame.
|
|
95
|
-
* @returns {Frame} A new Frame instance with the same properties.
|
|
96
|
-
*/
|
|
97
|
-
clone() {
|
|
88
|
+
clone(): Frame {
|
|
98
89
|
return cloneFrame(this);
|
|
99
90
|
}
|
|
100
91
|
|
|
101
|
-
|
|
102
|
-
* Gets the rectangle bounds of this frame.
|
|
103
|
-
* @param {Rectangle} output - The rectangle to use for the result (optional).
|
|
104
|
-
* @returns {Rectangle} A Rectangle object representing this frame's bounds.
|
|
105
|
-
*/
|
|
106
|
-
getRect(output = null) {
|
|
92
|
+
getRect(output: Rectangle | null = null): Rectangle {
|
|
107
93
|
const result = output || new Rectangle();
|
|
108
94
|
result.setTo(this.x, this.y, this.width, this.height);
|
|
109
95
|
return result;
|
|
110
96
|
}
|
|
111
|
-
}
|
|
97
|
+
}
|