@vpmedia/phaser 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +2 -2
- package/src/phaser/core/animation.js +0 -3
- package/src/phaser/core/animation_manager.js +0 -2
- package/src/phaser/core/animation_parser.js +0 -1
- package/src/phaser/core/cache.js +36 -17
- package/src/phaser/core/dom.js +3 -4
- package/src/phaser/core/event_manager.js +0 -1
- package/src/phaser/core/factory.js +0 -1
- package/src/phaser/core/frame_data.js +0 -1
- package/src/phaser/core/input.js +12 -13
- package/src/phaser/core/input_handler.js +1 -4
- package/src/phaser/core/input_mouse.js +3 -4
- package/src/phaser/core/input_mspointer.js +0 -2
- package/src/phaser/core/input_pointer.js +1 -2
- package/src/phaser/core/input_touch.js +0 -2
- package/src/phaser/core/loader.js +69 -70
- package/src/phaser/core/raf.js +0 -2
- package/src/phaser/core/scale_manager.js +0 -1
- package/src/phaser/core/scene_manager.js +1 -2
- package/src/phaser/core/signal_binding.js +14 -7
- package/src/phaser/core/sound.js +0 -1
- package/src/phaser/core/sound_manager.js +0 -1
- package/src/phaser/core/sound_sprite.js +0 -3
- package/src/phaser/core/stage.js +0 -1
- package/src/phaser/core/time.js +0 -1
- package/src/phaser/core/timer.js +0 -1
- package/src/phaser/core/timer_event.js +0 -2
- package/src/phaser/core/tween.js +5 -7
- package/src/phaser/core/tween_data.js +1 -1
- package/src/phaser/core/tween_manager.js +0 -1
- package/src/phaser/core/world.js +0 -1
- package/src/phaser/display/bitmap_text.js +0 -1
- package/src/phaser/display/button.js +0 -1
- package/src/phaser/display/canvas/renderer.js +5 -6
- package/src/phaser/display/display_object.js +1 -0
- package/src/phaser/display/graphics.js +4 -6
- package/src/phaser/display/group.js +0 -1
- package/src/phaser/display/image.js +5 -6
- package/src/phaser/display/sprite_batch.js +0 -1
- package/src/phaser/display/sprite_util.js +0 -1
- package/src/phaser/display/text.js +41 -32
- package/src/phaser/display/webgl/abstract_filter.js +1 -1
- package/src/phaser/display/webgl/fast_sprite_batch.js +1 -1
- package/src/phaser/display/webgl/graphics.js +6 -6
- package/src/phaser/display/webgl/render_texture.js +1 -1
- package/src/phaser/display/webgl/renderer.js +6 -7
- package/src/phaser/display/webgl/shader/normal.js +1 -1
- package/src/phaser/display/webgl/shader_manager.js +3 -2
- package/src/phaser/display/webgl/sprite_batch.js +1 -3
- package/src/phaser/display/webgl/stencil_manager.js +6 -6
- package/src/phaser/display/webgl/texture.js +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Signal } from './signal';
|
|
2
2
|
import { Rectangle } from '../geom/rectangle';
|
|
3
3
|
import { canPlayAudio } from './device_util';
|
|
4
|
-
import { Game } from './game';
|
|
5
4
|
|
|
6
5
|
const TEXTURE_ATLAS_JSON_HASH = 1;
|
|
7
6
|
|
|
@@ -47,8 +46,8 @@ export class Loader {
|
|
|
47
46
|
|
|
48
47
|
/**
|
|
49
48
|
* TBD.
|
|
50
|
-
* @param sprite - TBD.
|
|
51
|
-
* @param direction - TBD.
|
|
49
|
+
* @param {Image} sprite - TBD.
|
|
50
|
+
* @param {number} direction - TBD.
|
|
52
51
|
*/
|
|
53
52
|
setPreloadSprite(sprite, direction = 0) {
|
|
54
53
|
this.preloadSprite = {
|
|
@@ -80,7 +79,7 @@ export class Loader {
|
|
|
80
79
|
|
|
81
80
|
/**
|
|
82
81
|
* TBD.
|
|
83
|
-
* @param type - TBD.
|
|
82
|
+
* @param {string} type - TBD.
|
|
84
83
|
* @param {string} key - TBD.
|
|
85
84
|
* @returns {boolean} TBD.
|
|
86
85
|
*/
|
|
@@ -90,7 +89,7 @@ export class Loader {
|
|
|
90
89
|
|
|
91
90
|
/**
|
|
92
91
|
* TBD.
|
|
93
|
-
* @param type - TBD.
|
|
92
|
+
* @param {string} type - TBD.
|
|
94
93
|
* @param {string} key - TBD.
|
|
95
94
|
* @returns {number} TBD.
|
|
96
95
|
*/
|
|
@@ -112,7 +111,7 @@ export class Loader {
|
|
|
112
111
|
|
|
113
112
|
/**
|
|
114
113
|
* TBD.
|
|
115
|
-
* @param type - TBD.
|
|
114
|
+
* @param {string} type - TBD.
|
|
116
115
|
* @param {string} key - TBD.
|
|
117
116
|
* @returns {object} TBD.
|
|
118
117
|
*/
|
|
@@ -126,10 +125,10 @@ export class Loader {
|
|
|
126
125
|
|
|
127
126
|
/**
|
|
128
127
|
* TBD.
|
|
129
|
-
* @param hard
|
|
130
|
-
* @param clearEvents
|
|
128
|
+
* @param {boolean} hard - TBD.
|
|
129
|
+
* @param {boolean} clearEvents - TBD.
|
|
131
130
|
*/
|
|
132
|
-
reset(hard, clearEvents = false) {
|
|
131
|
+
reset(hard = false, clearEvents = false) {
|
|
133
132
|
if (hard) {
|
|
134
133
|
this.preloadSprite = null;
|
|
135
134
|
}
|
|
@@ -154,12 +153,12 @@ export class Loader {
|
|
|
154
153
|
|
|
155
154
|
/**
|
|
156
155
|
* TBD.
|
|
157
|
-
* @param type - TBD.
|
|
156
|
+
* @param {string} type - TBD.
|
|
158
157
|
* @param {string} key - TBD.
|
|
159
158
|
* @param {string} url - TBD.
|
|
160
|
-
* @param properties - TBD.
|
|
161
|
-
* @param overwrite - TBD.
|
|
162
|
-
* @param extension - TBD.
|
|
159
|
+
* @param {object} properties - TBD.
|
|
160
|
+
* @param {boolean} overwrite - TBD.
|
|
161
|
+
* @param {string} extension - TBD.
|
|
163
162
|
* @returns {Loader} TBD.
|
|
164
163
|
*/
|
|
165
164
|
addToFileList(type, key = '', url = null, properties = null, overwrite = false, extension = null) {
|
|
@@ -211,10 +210,10 @@ export class Loader {
|
|
|
211
210
|
|
|
212
211
|
/**
|
|
213
212
|
* TBD.
|
|
214
|
-
* @param type - TBD.
|
|
213
|
+
* @param {string} type - TBD.
|
|
215
214
|
* @param {string} key - TBD.
|
|
216
215
|
* @param {string} url - TBD.
|
|
217
|
-
* @param properties - TBD.
|
|
216
|
+
* @param {object} properties - TBD.
|
|
218
217
|
* @returns {Loader} TBD.
|
|
219
218
|
*/
|
|
220
219
|
replaceInFileList(type, key, url, properties) {
|
|
@@ -225,7 +224,7 @@ export class Loader {
|
|
|
225
224
|
* TBD.
|
|
226
225
|
* @param {string} key - TBD.
|
|
227
226
|
* @param {string} url - TBD.
|
|
228
|
-
* @param data - TBD.
|
|
227
|
+
* @param {object} data - TBD.
|
|
229
228
|
* @param {object} callbackContext - TBD.
|
|
230
229
|
* @returns {Loader} TBD.
|
|
231
230
|
*/
|
|
@@ -264,17 +263,17 @@ export class Loader {
|
|
|
264
263
|
* TBD.
|
|
265
264
|
* @param {string} key - TBD.
|
|
266
265
|
* @param {string} url - TBD.
|
|
267
|
-
* @param overwrite - TBD.
|
|
266
|
+
* @param {boolean} overwrite - TBD.
|
|
268
267
|
* @returns {Loader} TBD.
|
|
269
268
|
*/
|
|
270
|
-
image(key, url, overwrite) {
|
|
269
|
+
image(key, url, overwrite = false) {
|
|
271
270
|
return this.addToFileList('image', key, url, undefined, overwrite, '.png');
|
|
272
271
|
}
|
|
273
272
|
|
|
274
273
|
/**
|
|
275
274
|
* TBD.
|
|
276
|
-
* @param keys - TBD.
|
|
277
|
-
* @param urls - TBD.
|
|
275
|
+
* @param {string[]} keys - TBD.
|
|
276
|
+
* @param {string[]} urls - TBD.
|
|
278
277
|
* @returns {Loader} TBD.
|
|
279
278
|
*/
|
|
280
279
|
images(keys, urls) {
|
|
@@ -294,7 +293,7 @@ export class Loader {
|
|
|
294
293
|
* TBD.
|
|
295
294
|
* @param {string} key - TBD.
|
|
296
295
|
* @param {string} url - TBD.
|
|
297
|
-
* @param overwrite - TBD.
|
|
296
|
+
* @param {boolean} overwrite - TBD.
|
|
298
297
|
* @returns {Loader} TBD.
|
|
299
298
|
*/
|
|
300
299
|
text(key, url, overwrite) {
|
|
@@ -305,7 +304,7 @@ export class Loader {
|
|
|
305
304
|
* TBD.
|
|
306
305
|
* @param {string} key - TBD.
|
|
307
306
|
* @param {string} url - TBD.
|
|
308
|
-
* @param overwrite - TBD.
|
|
307
|
+
* @param {boolean} overwrite - TBD.
|
|
309
308
|
* @returns {Loader} TBD.
|
|
310
309
|
*/
|
|
311
310
|
json(key, url, overwrite) {
|
|
@@ -316,7 +315,7 @@ export class Loader {
|
|
|
316
315
|
* TBD.
|
|
317
316
|
* @param {string} key - TBD.
|
|
318
317
|
* @param {string} url - TBD.
|
|
319
|
-
* @param overwrite - TBD.
|
|
318
|
+
* @param {boolean} overwrite - TBD.
|
|
320
319
|
* @returns {Loader} TBD.
|
|
321
320
|
*/
|
|
322
321
|
xml(key, url, overwrite) {
|
|
@@ -327,11 +326,11 @@ export class Loader {
|
|
|
327
326
|
* TBD.
|
|
328
327
|
* @param {string} key - TBD.
|
|
329
328
|
* @param {string} url - TBD.
|
|
330
|
-
* @param frameWidth - TBD.
|
|
331
|
-
* @param frameHeight - TBD.
|
|
332
|
-
* @param frameMax - TBD.
|
|
333
|
-
* @param margin - TBD.
|
|
334
|
-
* @param spacing - TBD.
|
|
329
|
+
* @param {number} frameWidth - TBD.
|
|
330
|
+
* @param {number} frameHeight - TBD.
|
|
331
|
+
* @param {number} frameMax - TBD.
|
|
332
|
+
* @param {number} margin - TBD.
|
|
333
|
+
* @param {number} spacing - TBD.
|
|
335
334
|
* @returns {Loader} TBD.
|
|
336
335
|
*/
|
|
337
336
|
spritesheet(key, url, frameWidth, frameHeight, frameMax = -1, margin = 0, spacing = 0) {
|
|
@@ -348,8 +347,8 @@ export class Loader {
|
|
|
348
347
|
/**
|
|
349
348
|
* TBD.
|
|
350
349
|
* @param {string} key - TBD.
|
|
351
|
-
* @param urls
|
|
352
|
-
* @param autoDecode
|
|
350
|
+
* @param {string[]} urls - TBD.
|
|
351
|
+
* @param {boolean} autoDecode - TBD.
|
|
353
352
|
* @returns {Loader} TBD.
|
|
354
353
|
*/
|
|
355
354
|
audio(key, urls, autoDecode = true) {
|
|
@@ -365,10 +364,10 @@ export class Loader {
|
|
|
365
364
|
/**
|
|
366
365
|
* TBD.
|
|
367
366
|
* @param {string} key - TBD.
|
|
368
|
-
* @param urls - TBD.
|
|
369
|
-
* @param jsonURL - TBD.
|
|
370
|
-
* @param jsonData - TBD.
|
|
371
|
-
* @param autoDecode - TBD.
|
|
367
|
+
* @param {string} urls - TBD.
|
|
368
|
+
* @param {string} jsonURL - TBD.
|
|
369
|
+
* @param {object} jsonData - TBD.
|
|
370
|
+
* @param {boolean} autoDecode - TBD.
|
|
372
371
|
* @returns {Loader} TBD.
|
|
373
372
|
*/
|
|
374
373
|
audioSprite(key, urls, jsonURL, jsonData, autoDecode = true) {
|
|
@@ -390,11 +389,11 @@ export class Loader {
|
|
|
390
389
|
/**
|
|
391
390
|
* TBD.
|
|
392
391
|
* @param {string} key - TBD.
|
|
393
|
-
* @param textureURL - TBD.
|
|
394
|
-
* @param atlasURL - TBD.
|
|
395
|
-
* @param atlasData - TBD.
|
|
396
|
-
* @param xSpacing - TBD.
|
|
397
|
-
* @param ySpacing - TBD.
|
|
392
|
+
* @param {string} textureURL - TBD.
|
|
393
|
+
* @param {string} atlasURL - TBD.
|
|
394
|
+
* @param {object} atlasData - TBD.
|
|
395
|
+
* @param {number} xSpacing - TBD.
|
|
396
|
+
* @param {number} ySpacing - TBD.
|
|
398
397
|
* @returns {Loader} TBD.
|
|
399
398
|
* @throws Error.
|
|
400
399
|
*/
|
|
@@ -434,10 +433,10 @@ export class Loader {
|
|
|
434
433
|
/**
|
|
435
434
|
* TBD.
|
|
436
435
|
* @param {string} key - TBD.
|
|
437
|
-
* @param textureURL - TBD.
|
|
438
|
-
* @param atlasURL - TBD.
|
|
439
|
-
* @param atlasData - TBD.
|
|
440
|
-
* @param format - TBD.
|
|
436
|
+
* @param {string} textureURL - TBD.
|
|
437
|
+
* @param {string} atlasURL - TBD.
|
|
438
|
+
* @param {object} atlasData - TBD.
|
|
439
|
+
* @param {number} format - TBD.
|
|
441
440
|
* @returns {Loader} TBD.
|
|
442
441
|
*/
|
|
443
442
|
atlas(key, textureURL, atlasURL = null, atlasData = null, format = TEXTURE_ATLAS_JSON_HASH) {
|
|
@@ -474,7 +473,7 @@ export class Loader {
|
|
|
474
473
|
|
|
475
474
|
/**
|
|
476
475
|
* TBD.
|
|
477
|
-
* @param type - TBD.
|
|
476
|
+
* @param {string} type - TBD.
|
|
478
477
|
* @param {string} key - TBD.
|
|
479
478
|
* @returns {Loader} TBD.
|
|
480
479
|
*/
|
|
@@ -488,7 +487,7 @@ export class Loader {
|
|
|
488
487
|
|
|
489
488
|
/**
|
|
490
489
|
* TBD.
|
|
491
|
-
* @param type - TBD.
|
|
490
|
+
* @param {string} type - TBD.
|
|
492
491
|
* @param {string} key - TBD.
|
|
493
492
|
*/
|
|
494
493
|
removeFile(type, key) {
|
|
@@ -621,7 +620,7 @@ export class Loader {
|
|
|
621
620
|
|
|
622
621
|
/**
|
|
623
622
|
* TBD.
|
|
624
|
-
* @param abnormal - TBD.
|
|
623
|
+
* @param {boolean} abnormal - TBD.
|
|
625
624
|
*/
|
|
626
625
|
finishedLoading(abnormal) {
|
|
627
626
|
if (this.hasLoaded) {
|
|
@@ -644,8 +643,8 @@ export class Loader {
|
|
|
644
643
|
|
|
645
644
|
/**
|
|
646
645
|
* TBD.
|
|
647
|
-
* @param file - TBD.
|
|
648
|
-
* @param errorMessage - TBD.
|
|
646
|
+
* @param {object} file - TBD.
|
|
647
|
+
* @param {string} errorMessage - TBD.
|
|
649
648
|
*/
|
|
650
649
|
asyncComplete(file, errorMessage = '') {
|
|
651
650
|
file.loaded = true;
|
|
@@ -660,7 +659,7 @@ export class Loader {
|
|
|
660
659
|
|
|
661
660
|
/**
|
|
662
661
|
* TBD.
|
|
663
|
-
* @param pack - TBD.
|
|
662
|
+
* @param {object} pack - TBD.
|
|
664
663
|
*/
|
|
665
664
|
processPack(pack) {
|
|
666
665
|
const packData = pack.data[pack.key];
|
|
@@ -724,7 +723,7 @@ export class Loader {
|
|
|
724
723
|
/**
|
|
725
724
|
* TBD.
|
|
726
725
|
* @param {string} url - TBD.
|
|
727
|
-
* @param file - TBD.
|
|
726
|
+
* @param {object} file - TBD.
|
|
728
727
|
* @returns {string} TBD.
|
|
729
728
|
*/
|
|
730
729
|
transformUrl(url, file) {
|
|
@@ -739,7 +738,7 @@ export class Loader {
|
|
|
739
738
|
|
|
740
739
|
/**
|
|
741
740
|
* TBD.
|
|
742
|
-
* @param file - TBD.
|
|
741
|
+
* @param {object} file - TBD.
|
|
743
742
|
*/
|
|
744
743
|
loadFile(file) {
|
|
745
744
|
switch (file.type) {
|
|
@@ -777,7 +776,7 @@ export class Loader {
|
|
|
777
776
|
|
|
778
777
|
/**
|
|
779
778
|
* TBD.
|
|
780
|
-
* @param file - TBD.
|
|
779
|
+
* @param {object} file - TBD.
|
|
781
780
|
*/
|
|
782
781
|
loadImageTag(file) {
|
|
783
782
|
this.log('loadImageTag', file);
|
|
@@ -809,13 +808,13 @@ export class Loader {
|
|
|
809
808
|
|
|
810
809
|
/**
|
|
811
810
|
* TBD.
|
|
812
|
-
* @param file - TBD.
|
|
811
|
+
* @param {object} file - TBD.
|
|
813
812
|
* @param {string} url - TBD.
|
|
814
|
-
* @param type - TBD.
|
|
815
|
-
* @param onload - TBD.
|
|
816
|
-
* @param onerror - TBD.
|
|
813
|
+
* @param {string} type - TBD.
|
|
814
|
+
* @param {Function} onload - TBD.
|
|
815
|
+
* @param {Function} onerror - TBD.
|
|
817
816
|
*/
|
|
818
|
-
xhrLoad(file, url, type, onload, onerror) {
|
|
817
|
+
xhrLoad(file, url, type, onload, onerror = null) {
|
|
819
818
|
this.log('xhrLoad', file);
|
|
820
819
|
const scope = this;
|
|
821
820
|
const xhr = new XMLHttpRequest();
|
|
@@ -884,7 +883,7 @@ export class Loader {
|
|
|
884
883
|
|
|
885
884
|
/**
|
|
886
885
|
* TBD.
|
|
887
|
-
* @param urls - TBD.
|
|
886
|
+
* @param {object[]} urls - TBD.
|
|
888
887
|
* @returns {string} TBD.
|
|
889
888
|
*/
|
|
890
889
|
getAudioURL(urls) {
|
|
@@ -922,9 +921,9 @@ export class Loader {
|
|
|
922
921
|
|
|
923
922
|
/**
|
|
924
923
|
* TBD.
|
|
925
|
-
* @param file - TBD.
|
|
926
|
-
* @param xhr - TBD.
|
|
927
|
-
* @param reason - TBD.
|
|
924
|
+
* @param {object} file - TBD.
|
|
925
|
+
* @param {XMLHttpRequest} xhr - TBD.
|
|
926
|
+
* @param {number} reason - TBD.
|
|
928
927
|
*/
|
|
929
928
|
fileError(file, xhr, reason) {
|
|
930
929
|
// const url = file.requestUrl || this.transformUrl(file.url, file);
|
|
@@ -940,8 +939,8 @@ export class Loader {
|
|
|
940
939
|
|
|
941
940
|
/**
|
|
942
941
|
* TBD.
|
|
943
|
-
* @param file - TBD.
|
|
944
|
-
* @param xhr - TBD.
|
|
942
|
+
* @param {object} file - TBD.
|
|
943
|
+
* @param {XMLHttpRequest} xhr - TBD.
|
|
945
944
|
* @throws Error.
|
|
946
945
|
*/
|
|
947
946
|
fileComplete(file, xhr) {
|
|
@@ -1032,8 +1031,8 @@ export class Loader {
|
|
|
1032
1031
|
|
|
1033
1032
|
/**
|
|
1034
1033
|
* TBD.
|
|
1035
|
-
* @param file - TBD.
|
|
1036
|
-
* @param xhr - TBD.
|
|
1034
|
+
* @param {object} file - TBD.
|
|
1035
|
+
* @param {XMLHttpRequest} xhr - TBD.
|
|
1037
1036
|
*/
|
|
1038
1037
|
jsonLoadComplete(file, xhr) {
|
|
1039
1038
|
const data = JSON.parse(xhr.responseText);
|
|
@@ -1057,8 +1056,8 @@ export class Loader {
|
|
|
1057
1056
|
|
|
1058
1057
|
/**
|
|
1059
1058
|
* TBD.
|
|
1060
|
-
* @param file - TBD.
|
|
1061
|
-
* @param xhr - TBD.
|
|
1059
|
+
* @param {object} file - TBD.
|
|
1060
|
+
* @param {XMLHttpRequest} xhr - TBD.
|
|
1062
1061
|
*/
|
|
1063
1062
|
xmlLoadComplete(file, xhr) {
|
|
1064
1063
|
// Always try parsing the content as XML, regardless of actually response type
|
|
@@ -1082,7 +1081,7 @@ export class Loader {
|
|
|
1082
1081
|
|
|
1083
1082
|
/**
|
|
1084
1083
|
* TBD.
|
|
1085
|
-
* @param data - TBD.
|
|
1084
|
+
* @param {object} data - TBD.
|
|
1086
1085
|
* @returns {Document} TBD.
|
|
1087
1086
|
*/
|
|
1088
1087
|
parseXml(data) {
|
|
@@ -1127,8 +1126,8 @@ export class Loader {
|
|
|
1127
1126
|
|
|
1128
1127
|
/**
|
|
1129
1128
|
* TBD.
|
|
1130
|
-
* @param message - TBD.
|
|
1131
|
-
* @param data - TBD.
|
|
1129
|
+
* @param {string} message - TBD.
|
|
1130
|
+
* @param {string|object} data - TBD.
|
|
1132
1131
|
*/
|
|
1133
1132
|
log(message, data = '') {
|
|
1134
1133
|
if (!this.isUseLog) {
|
package/src/phaser/core/raf.js
CHANGED
|
@@ -3,7 +3,6 @@ import { DOM } from './dom';
|
|
|
3
3
|
import { Point } from '../geom/point';
|
|
4
4
|
import { Rectangle } from '../geom/rectangle';
|
|
5
5
|
import { SCALE_OFF, SCALE_RESIZE, SCALE_EXACT_FIT, SCALE_USER, SCALE_SHOW_ALL, RENDER_CANVAS } from './const';
|
|
6
|
-
import { Game } from './game';
|
|
7
6
|
|
|
8
7
|
export class ScaleManager {
|
|
9
8
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Game } from './game';
|
|
2
1
|
import { Scene } from './scene';
|
|
3
2
|
|
|
4
3
|
export class SceneManager {
|
|
@@ -40,7 +39,7 @@ export class SceneManager {
|
|
|
40
39
|
/**
|
|
41
40
|
* TBD.
|
|
42
41
|
* @param {string} key - TBD.
|
|
43
|
-
* @param state - TBD.
|
|
42
|
+
* @param {object} state - TBD.
|
|
44
43
|
* @param {boolean} autoStart - TBD.
|
|
45
44
|
* @returns {Scene|object} TBD.
|
|
46
45
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export class SignalBinding {
|
|
2
2
|
/**
|
|
3
3
|
* TBD.
|
|
4
|
-
* @param signal
|
|
5
|
-
* @param listener
|
|
6
|
-
* @param isOnce
|
|
7
|
-
* @param listenerContext
|
|
8
|
-
* @param priority
|
|
9
|
-
* @param args - TBD.
|
|
4
|
+
* @param {Signal} signal - TBD.
|
|
5
|
+
* @param {Function} listener - TBD.
|
|
6
|
+
* @param {boolean} isOnce - TBD.
|
|
7
|
+
* @param {object} listenerContext - TBD.
|
|
8
|
+
* @param {number} priority - TBD.
|
|
9
|
+
* @param {...any} args - TBD.
|
|
10
10
|
*/
|
|
11
11
|
constructor(signal, listener, isOnce = false, listenerContext = null, priority = 0, args = null) {
|
|
12
12
|
this._signal = signal;
|
|
@@ -22,7 +22,8 @@ export class SignalBinding {
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* TBD.
|
|
25
|
-
* @param paramsArr
|
|
25
|
+
* @param {any[]} paramsArr - TBD.
|
|
26
|
+
* @returns {Function} TBD.
|
|
26
27
|
*/
|
|
27
28
|
execute(paramsArr) {
|
|
28
29
|
let handlerReturn;
|
|
@@ -43,6 +44,7 @@ export class SignalBinding {
|
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
46
|
* TBD.
|
|
47
|
+
* @returns {Function} TBD.
|
|
46
48
|
*/
|
|
47
49
|
detach() {
|
|
48
50
|
return this.isBound() ? this._signal.remove(this._listener, this.context) : null;
|
|
@@ -50,6 +52,7 @@ export class SignalBinding {
|
|
|
50
52
|
|
|
51
53
|
/**
|
|
52
54
|
* TBD.
|
|
55
|
+
* @returns {boolean} TBD.
|
|
53
56
|
*/
|
|
54
57
|
isBound() {
|
|
55
58
|
return !!this._signal && !!this._listener;
|
|
@@ -57,6 +60,7 @@ export class SignalBinding {
|
|
|
57
60
|
|
|
58
61
|
/**
|
|
59
62
|
* TBD.
|
|
63
|
+
* @returns {boolean} TBD.
|
|
60
64
|
*/
|
|
61
65
|
isOnce() {
|
|
62
66
|
return this._isOnce;
|
|
@@ -64,6 +68,7 @@ export class SignalBinding {
|
|
|
64
68
|
|
|
65
69
|
/**
|
|
66
70
|
* TBD.
|
|
71
|
+
* @returns {Function} TBD.
|
|
67
72
|
*/
|
|
68
73
|
getListener() {
|
|
69
74
|
return this._listener;
|
|
@@ -71,6 +76,7 @@ export class SignalBinding {
|
|
|
71
76
|
|
|
72
77
|
/**
|
|
73
78
|
* TBD.
|
|
79
|
+
* @returns {Signal} TBD.
|
|
74
80
|
*/
|
|
75
81
|
getSignal() {
|
|
76
82
|
return this._signal;
|
|
@@ -87,6 +93,7 @@ export class SignalBinding {
|
|
|
87
93
|
|
|
88
94
|
/**
|
|
89
95
|
* TBD.
|
|
96
|
+
* @returns {string} TBD.
|
|
90
97
|
*/
|
|
91
98
|
toString() {
|
|
92
99
|
return '[SignalBinding isOnce:' + this._isOnce + ', isBound:' + this.isBound() + ', active:' + this.active + ']';
|
package/src/phaser/core/sound.js
CHANGED
package/src/phaser/core/stage.js
CHANGED
|
@@ -3,7 +3,6 @@ import { DisplayObject } from '../display/display_object';
|
|
|
3
3
|
import { setUserSelect, setTouchAction } from '../display/canvas/util';
|
|
4
4
|
import { valueToColor } from '../util/math';
|
|
5
5
|
import { SCALE_LINEAR, SCALE_NEAREST } from './const';
|
|
6
|
-
import { Game } from './game';
|
|
7
6
|
|
|
8
7
|
export class Stage extends DisplayObject {
|
|
9
8
|
/**
|
package/src/phaser/core/time.js
CHANGED
package/src/phaser/core/timer.js
CHANGED
package/src/phaser/core/tween.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { Signal } from './signal';
|
|
2
2
|
import { TweenData } from './tween_data';
|
|
3
|
-
import { TweenManager } from './tween_manager';
|
|
4
|
-
import { DisplayObject } from '../display/display_object';
|
|
5
3
|
import * as MathUtils from '../util/math';
|
|
6
4
|
import { TWEEN_PENDING, TWEEN_RUNNING, TWEEN_COMPLETE, TWEEN_LOOPED } from './const';
|
|
7
|
-
import { Game } from './game';
|
|
8
5
|
|
|
9
6
|
export class Tween {
|
|
10
7
|
/**
|
|
@@ -148,7 +145,7 @@ export class Tween {
|
|
|
148
145
|
/**
|
|
149
146
|
* TBD.
|
|
150
147
|
* @param {string} property - TBD.
|
|
151
|
-
* @param {
|
|
148
|
+
* @param {object} value - TBD.
|
|
152
149
|
* @param {number} index - TBD.
|
|
153
150
|
* @returns {Tween} TBD.
|
|
154
151
|
*/
|
|
@@ -235,8 +232,8 @@ export class Tween {
|
|
|
235
232
|
|
|
236
233
|
/**
|
|
237
234
|
* TBD.
|
|
238
|
-
* @param interpolation - TBD.
|
|
239
|
-
* @param context - TBD.
|
|
235
|
+
* @param {Function} interpolation - TBD.
|
|
236
|
+
* @param {object} context - TBD.
|
|
240
237
|
* @param {number} index - TBD.
|
|
241
238
|
* @returns {Tween} TBD.
|
|
242
239
|
*/
|
|
@@ -424,7 +421,8 @@ export class Tween {
|
|
|
424
421
|
/**
|
|
425
422
|
* TBD.
|
|
426
423
|
* @param {number} frameRate - TBD.
|
|
427
|
-
* @param data - TBD.
|
|
424
|
+
* @param {object[]} data - TBD.
|
|
425
|
+
* @returns {object[]} TBD.
|
|
428
426
|
*/
|
|
429
427
|
generateData(frameRate = 60, data = []) {
|
|
430
428
|
if (this.game === null || this.target === null) {
|
package/src/phaser/core/world.js
CHANGED
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
import { getSmoothingPrefix } from './util';
|
|
24
24
|
import { detectCapabilities } from './tinter';
|
|
25
25
|
import * as CanvasMaskManager from './masker';
|
|
26
|
-
import { Game } from '../../core/game';
|
|
27
26
|
|
|
28
27
|
export class CanvasRenderer {
|
|
29
28
|
/**
|
|
@@ -60,7 +59,7 @@ export class CanvasRenderer {
|
|
|
60
59
|
|
|
61
60
|
/**
|
|
62
61
|
* TBD.
|
|
63
|
-
* @param root - TBD.
|
|
62
|
+
* @param {Stage} root - TBD.
|
|
64
63
|
*/
|
|
65
64
|
render(root) {
|
|
66
65
|
if (!this.context) {
|
|
@@ -85,7 +84,7 @@ export class CanvasRenderer {
|
|
|
85
84
|
|
|
86
85
|
/**
|
|
87
86
|
* TBD.
|
|
88
|
-
* @param removeView - TBD.
|
|
87
|
+
* @param {boolean} removeView - TBD.
|
|
89
88
|
*/
|
|
90
89
|
destroy(removeView = true) {
|
|
91
90
|
if (removeView && this.view.parent) {
|
|
@@ -117,9 +116,9 @@ export class CanvasRenderer {
|
|
|
117
116
|
|
|
118
117
|
/**
|
|
119
118
|
* TBD.
|
|
120
|
-
* @param displayObject - TBD.
|
|
121
|
-
* @param context - TBD.
|
|
122
|
-
* @param matrix - TBD.
|
|
119
|
+
* @param {Image} displayObject - TBD.
|
|
120
|
+
* @param {CanvasRenderingContext2D} context - TBD.
|
|
121
|
+
* @param {Matrix} matrix - TBD.
|
|
123
122
|
*/
|
|
124
123
|
renderDisplayObject(displayObject, context, matrix) {
|
|
125
124
|
this.renderSession.context = context || this.context;
|