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