@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,13 +1,11 @@
|
|
|
1
1
|
import { DisplayObject } from './display_object';
|
|
2
2
|
import { Image } from './image';
|
|
3
|
-
import { Game } from '../core/game';
|
|
4
3
|
import { Rectangle } from '../geom/rectangle';
|
|
5
4
|
import { RoundedRectangle } from '../geom/rounded_rectangle';
|
|
6
5
|
import { Polygon } from '../geom/polygon';
|
|
7
6
|
import { Circle } from '../geom/circle';
|
|
8
7
|
import { Ellipse } from '../geom/ellipse';
|
|
9
8
|
import { Point } from '../geom/point';
|
|
10
|
-
import { Matrix } from '../geom/matrix';
|
|
11
9
|
import { GraphicsData } from './graphics_data';
|
|
12
10
|
import { CanvasBuffer } from './canvas/buffer';
|
|
13
11
|
import { textureFromCanvas } from './webgl/texture_util';
|
|
@@ -841,8 +839,8 @@ export class Graphics extends DisplayObject {
|
|
|
841
839
|
|
|
842
840
|
/**
|
|
843
841
|
* TBD.
|
|
844
|
-
* @param points - TBD.
|
|
845
|
-
* @param cull - TBD.
|
|
842
|
+
* @param {Point[]} points - TBD.
|
|
843
|
+
* @param {boolean} cull - TBD.
|
|
846
844
|
*/
|
|
847
845
|
drawTriangle(points, cull = false) {
|
|
848
846
|
const triangle = new Polygon(points);
|
|
@@ -861,8 +859,8 @@ export class Graphics extends DisplayObject {
|
|
|
861
859
|
|
|
862
860
|
/**
|
|
863
861
|
* TBD.
|
|
864
|
-
* @param vertices - TBD.
|
|
865
|
-
* @param indices - TBD.
|
|
862
|
+
* @param {number[]|Point[]} vertices - TBD.
|
|
863
|
+
* @param {number[]} indices - TBD.
|
|
866
864
|
* @param {boolean} cull - TBD.
|
|
867
865
|
*/
|
|
868
866
|
drawTriangles(vertices, indices, cull = false) {
|
|
@@ -2,9 +2,7 @@ import { Texture } from './webgl/texture';
|
|
|
2
2
|
import { AnimationManager } from '../core/animation_manager';
|
|
3
3
|
import { EventManager } from '../core/event_manager';
|
|
4
4
|
import { Rectangle } from '../geom/rectangle';
|
|
5
|
-
import { Matrix } from '../geom/matrix';
|
|
6
5
|
import { DisplayObject } from './display_object';
|
|
7
|
-
import { Game } from '../core/game';
|
|
8
6
|
import { clone } from '../geom/util/rectangle';
|
|
9
7
|
import { IMAGE, PENDING_ATLAS, BLEND_NORMAL, SCALE_NEAREST } from '../core/const';
|
|
10
8
|
import { setTexture, getBounds, getLocalBounds, renderCanvas, renderWebGL } from './sprite_util';
|
|
@@ -140,7 +138,7 @@ export class Image extends DisplayObject {
|
|
|
140
138
|
|
|
141
139
|
/**
|
|
142
140
|
* TBD.
|
|
143
|
-
* @param frame - TBD.
|
|
141
|
+
* @param {Frame} frame - TBD.
|
|
144
142
|
*/
|
|
145
143
|
setFrame(frame) {
|
|
146
144
|
this._frame = frame;
|
|
@@ -185,7 +183,7 @@ export class Image extends DisplayObject {
|
|
|
185
183
|
|
|
186
184
|
/**
|
|
187
185
|
* TBD.
|
|
188
|
-
* @param parent - TBD.
|
|
186
|
+
* @param {DisplayObject} parent - TBD.
|
|
189
187
|
* @param {number} width - TBD.
|
|
190
188
|
* @param {number} height - TBD.
|
|
191
189
|
*/
|
|
@@ -205,6 +203,7 @@ export class Image extends DisplayObject {
|
|
|
205
203
|
|
|
206
204
|
/**
|
|
207
205
|
* TBD.
|
|
206
|
+
* @returns {number} TBD.
|
|
208
207
|
*/
|
|
209
208
|
get frame() {
|
|
210
209
|
return this.animations.frame;
|
|
@@ -236,7 +235,7 @@ export class Image extends DisplayObject {
|
|
|
236
235
|
|
|
237
236
|
/**
|
|
238
237
|
* TBD.
|
|
239
|
-
* @param rect - TBD.
|
|
238
|
+
* @param {Rectangle} rect - TBD.
|
|
240
239
|
* @param {boolean} copy - TBD.
|
|
241
240
|
*/
|
|
242
241
|
crop(rect, copy = false) {
|
|
@@ -335,7 +334,7 @@ export class Image extends DisplayObject {
|
|
|
335
334
|
|
|
336
335
|
/**
|
|
337
336
|
* TBD.
|
|
338
|
-
* @param texture - TBD.
|
|
337
|
+
* @param {Texture} texture - TBD.
|
|
339
338
|
* @param {boolean} destroyBase - TBD.
|
|
340
339
|
*/
|
|
341
340
|
setTexture(texture, destroyBase = false) {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Point } from '../geom/point';
|
|
2
2
|
import { Rectangle } from '../geom/rectangle';
|
|
3
|
-
import { Matrix } from '../geom/matrix';
|
|
4
3
|
import { Image } from './image';
|
|
5
4
|
import { create, remove } from './canvas/pool';
|
|
6
5
|
import { textureFromCanvas } from './webgl/texture_util';
|
|
7
|
-
import { Game } from '../core/game';
|
|
8
6
|
import { TEXT } from '../core/const';
|
|
9
7
|
import { snapToCeil } from '../util/math';
|
|
10
8
|
import { renderCanvas, renderWebGL, getBounds } from './sprite_util';
|
|
@@ -71,10 +69,11 @@ export class Text extends Image {
|
|
|
71
69
|
* TBD.
|
|
72
70
|
* @param {number} x - TBD.
|
|
73
71
|
* @param {number} y - TBD.
|
|
74
|
-
* @param color - TBD.
|
|
75
|
-
* @param blur - TBD.
|
|
76
|
-
* @param shadowStroke - TBD.
|
|
77
|
-
* @param shadowFill - TBD.
|
|
72
|
+
* @param {string} color - TBD.
|
|
73
|
+
* @param {number} blur - TBD.
|
|
74
|
+
* @param {boolean} shadowStroke - TBD.
|
|
75
|
+
* @param {boolean} shadowFill - TBD.
|
|
76
|
+
* @returns {Text} TBD.
|
|
78
77
|
*/
|
|
79
78
|
setShadow(x = 0, y = 0, color = 'rgba(0, 0, 0, 1)', blur = 0, shadowStroke = true, shadowFill = true) {
|
|
80
79
|
this.style.shadowOffsetX = x;
|
|
@@ -89,8 +88,9 @@ export class Text extends Image {
|
|
|
89
88
|
|
|
90
89
|
/**
|
|
91
90
|
* TBD.
|
|
92
|
-
* @param style
|
|
93
|
-
* @param update
|
|
91
|
+
* @param {object} style - TBD.
|
|
92
|
+
* @param {boolean} update - TBD.
|
|
93
|
+
* @returns {Text} TBD.
|
|
94
94
|
*/
|
|
95
95
|
setStyle(style = null, update = false) {
|
|
96
96
|
style = JSON.parse(JSON.stringify(style)) || {};
|
|
@@ -298,10 +298,10 @@ export class Text extends Image {
|
|
|
298
298
|
|
|
299
299
|
/**
|
|
300
300
|
* TBD.
|
|
301
|
-
* @param line - TBD.
|
|
301
|
+
* @param {string} line - TBD.
|
|
302
302
|
* @param {number} x - TBD.
|
|
303
303
|
* @param {number} y - TBD.
|
|
304
|
-
* @param fill - TBD.
|
|
304
|
+
* @param {boolean} fill - TBD.
|
|
305
305
|
*/
|
|
306
306
|
renderTabLine(line, x, y, fill) {
|
|
307
307
|
const text = line.split(/(?:\t)/);
|
|
@@ -337,7 +337,7 @@ export class Text extends Image {
|
|
|
337
337
|
|
|
338
338
|
/**
|
|
339
339
|
* TBD.
|
|
340
|
-
* @param state
|
|
340
|
+
* @param {string} state - TBD.
|
|
341
341
|
*/
|
|
342
342
|
updateShadow(state) {
|
|
343
343
|
if (state) {
|
|
@@ -355,7 +355,8 @@ export class Text extends Image {
|
|
|
355
355
|
|
|
356
356
|
/**
|
|
357
357
|
* TBD.
|
|
358
|
-
* @param line - TBD.
|
|
358
|
+
* @param {string} line - TBD.
|
|
359
|
+
* @returns {number} TBD.
|
|
359
360
|
*/
|
|
360
361
|
measureLine(line) {
|
|
361
362
|
let lineLength = 0;
|
|
@@ -391,7 +392,7 @@ export class Text extends Image {
|
|
|
391
392
|
|
|
392
393
|
/**
|
|
393
394
|
* TBD.
|
|
394
|
-
* @param line - TBD.
|
|
395
|
+
* @param {string} line - TBD.
|
|
395
396
|
* @param {number} x - TBD.
|
|
396
397
|
* @param {number} y - TBD.
|
|
397
398
|
*/
|
|
@@ -451,8 +452,8 @@ export class Text extends Image {
|
|
|
451
452
|
|
|
452
453
|
/**
|
|
453
454
|
* TBD.
|
|
454
|
-
* @param color - TBD.
|
|
455
|
-
* @param position - TBD.
|
|
455
|
+
* @param {number} color - TBD.
|
|
456
|
+
* @param {number} position - TBD.
|
|
456
457
|
* @returns {Text} TBD.
|
|
457
458
|
*/
|
|
458
459
|
addColor(color, position) {
|
|
@@ -463,8 +464,8 @@ export class Text extends Image {
|
|
|
463
464
|
|
|
464
465
|
/**
|
|
465
466
|
* TBD.
|
|
466
|
-
* @param color - TBD.
|
|
467
|
-
* @param position - TBD.
|
|
467
|
+
* @param {number} color - TBD.
|
|
468
|
+
* @param {number} position - TBD.
|
|
468
469
|
* @returns {Text} TBD.
|
|
469
470
|
*/
|
|
470
471
|
addStrokeColor(color, position) {
|
|
@@ -475,8 +476,8 @@ export class Text extends Image {
|
|
|
475
476
|
|
|
476
477
|
/**
|
|
477
478
|
* TBD.
|
|
478
|
-
* @param style - TBD.
|
|
479
|
-
* @param position - TBD.
|
|
479
|
+
* @param {object} style - TBD.
|
|
480
|
+
* @param {number} position - TBD.
|
|
480
481
|
* @returns {Text} TBD.
|
|
481
482
|
*/
|
|
482
483
|
addFontStyle(style, position) {
|
|
@@ -487,8 +488,8 @@ export class Text extends Image {
|
|
|
487
488
|
|
|
488
489
|
/**
|
|
489
490
|
* TBD.
|
|
490
|
-
* @param weight - TBD.
|
|
491
|
-
* @param position - TBD.
|
|
491
|
+
* @param {number} weight - TBD.
|
|
492
|
+
* @param {number} position - TBD.
|
|
492
493
|
* @returns {Text} TBD.
|
|
493
494
|
*/
|
|
494
495
|
addFontWeight(weight, position) {
|
|
@@ -499,7 +500,8 @@ export class Text extends Image {
|
|
|
499
500
|
|
|
500
501
|
/**
|
|
501
502
|
* TBD.
|
|
502
|
-
* @param text - TBD.
|
|
503
|
+
* @param {string} text - TBD.
|
|
504
|
+
* @returns {string[]} TBD.
|
|
503
505
|
*/
|
|
504
506
|
precalculateWordWrap(text) {
|
|
505
507
|
this.texture.baseTexture.resolution = this._res;
|
|
@@ -510,7 +512,8 @@ export class Text extends Image {
|
|
|
510
512
|
|
|
511
513
|
/**
|
|
512
514
|
* TBD.
|
|
513
|
-
* @param text - TBD.
|
|
515
|
+
* @param {string} text - TBD.
|
|
516
|
+
* @returns {string} TBD.
|
|
514
517
|
*/
|
|
515
518
|
runWordWrap(text) {
|
|
516
519
|
if (this.useAdvancedWrap) {
|
|
@@ -521,7 +524,9 @@ export class Text extends Image {
|
|
|
521
524
|
|
|
522
525
|
/**
|
|
523
526
|
* TBD.
|
|
524
|
-
* @param text - TBD.
|
|
527
|
+
* @param {string} text - TBD.
|
|
528
|
+
* @returns {string} TBD.
|
|
529
|
+
* @throws Error.
|
|
525
530
|
*/
|
|
526
531
|
advancedWordWrap(text) {
|
|
527
532
|
const context = this.context;
|
|
@@ -602,7 +607,8 @@ export class Text extends Image {
|
|
|
602
607
|
|
|
603
608
|
/**
|
|
604
609
|
* TBD.
|
|
605
|
-
* @param text - TBD.
|
|
610
|
+
* @param {string} text - TBD.
|
|
611
|
+
* @returns {string} TBD.
|
|
606
612
|
*/
|
|
607
613
|
basicWordWrap(text) {
|
|
608
614
|
let result = '';
|
|
@@ -634,7 +640,7 @@ export class Text extends Image {
|
|
|
634
640
|
|
|
635
641
|
/**
|
|
636
642
|
* TBD.
|
|
637
|
-
* @param components
|
|
643
|
+
* @param {object} components - TBD.
|
|
638
644
|
*/
|
|
639
645
|
updateFont(components) {
|
|
640
646
|
const font = this.componentsToFont(components);
|
|
@@ -649,7 +655,7 @@ export class Text extends Image {
|
|
|
649
655
|
|
|
650
656
|
/**
|
|
651
657
|
* TBD.
|
|
652
|
-
* @param font - TBD.
|
|
658
|
+
* @param {string} font - TBD.
|
|
653
659
|
* @returns {object} TBD.
|
|
654
660
|
*/
|
|
655
661
|
fontToComponents(font) {
|
|
@@ -685,7 +691,8 @@ export class Text extends Image {
|
|
|
685
691
|
|
|
686
692
|
/**
|
|
687
693
|
* TBD.
|
|
688
|
-
* @param components - TBD.
|
|
694
|
+
* @param {object} components - TBD.
|
|
695
|
+
* @returns {string} TBD.
|
|
689
696
|
*/
|
|
690
697
|
componentsToFont(components) {
|
|
691
698
|
const parts = [];
|
|
@@ -719,8 +726,8 @@ export class Text extends Image {
|
|
|
719
726
|
|
|
720
727
|
/**
|
|
721
728
|
* TBD.
|
|
722
|
-
* @param text - TBD.
|
|
723
|
-
* @param immediate - TBD.
|
|
729
|
+
* @param {string} text - TBD.
|
|
730
|
+
* @param {boolean} immediate - TBD.
|
|
724
731
|
* @returns {Text} TBD.
|
|
725
732
|
*/
|
|
726
733
|
setText(text, immediate = false) {
|
|
@@ -735,7 +742,7 @@ export class Text extends Image {
|
|
|
735
742
|
|
|
736
743
|
/**
|
|
737
744
|
* TBD.
|
|
738
|
-
* @param list
|
|
745
|
+
* @param {string[]|string[][]} list - TBD.
|
|
739
746
|
* @returns {Text} TBD.
|
|
740
747
|
*/
|
|
741
748
|
parseList(list) {
|
|
@@ -876,6 +883,7 @@ export class Text extends Image {
|
|
|
876
883
|
|
|
877
884
|
/**
|
|
878
885
|
* TBD.
|
|
886
|
+
* @returns {CanvasRenderingContext2D} TBD.
|
|
879
887
|
*/
|
|
880
888
|
getFontPropertiesContext() {
|
|
881
889
|
if (!window.PhaserRegistry.fontPropertiesContext) {
|
|
@@ -888,7 +896,8 @@ export class Text extends Image {
|
|
|
888
896
|
|
|
889
897
|
/**
|
|
890
898
|
* TBD.
|
|
891
|
-
* @param fontStyle
|
|
899
|
+
* @param {string} fontStyle - TBD.
|
|
900
|
+
* @returns {object} TBD.
|
|
892
901
|
*/
|
|
893
902
|
determineFontProperties(fontStyle) {
|
|
894
903
|
const fontPropertiesCache = this.getFontPropertiesCache();
|
|
@@ -53,7 +53,7 @@ export function switchMode(webGL, type) {
|
|
|
53
53
|
/**
|
|
54
54
|
* TBD.
|
|
55
55
|
* @param {object} graphicsData - TBD.
|
|
56
|
-
* @param {
|
|
56
|
+
* @param {GraphicsData} webGLData - TBD.
|
|
57
57
|
*/
|
|
58
58
|
export function buildLine(graphicsData, webGLData) {
|
|
59
59
|
// TODO OPTIMISE!
|
|
@@ -218,7 +218,7 @@ export function buildLine(graphicsData, webGLData) {
|
|
|
218
218
|
/**
|
|
219
219
|
* TBD.
|
|
220
220
|
* @param {object} graphicsData - TBD.
|
|
221
|
-
* @param {
|
|
221
|
+
* @param {GraphicsData} webGLData - TBD.
|
|
222
222
|
*/
|
|
223
223
|
export function buildRectangle(graphicsData, webGLData) {
|
|
224
224
|
//
|
|
@@ -301,7 +301,7 @@ export function quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY) {
|
|
|
301
301
|
/**
|
|
302
302
|
* TBD.
|
|
303
303
|
* @param {object} graphicsData - TBD.
|
|
304
|
-
* @param {
|
|
304
|
+
* @param {GraphicsData} webGLData - TBD.
|
|
305
305
|
*/
|
|
306
306
|
export function buildRoundedRectangle(graphicsData, webGLData) {
|
|
307
307
|
const rrectData = graphicsData.shape;
|
|
@@ -351,7 +351,7 @@ export function buildRoundedRectangle(graphicsData, webGLData) {
|
|
|
351
351
|
/**
|
|
352
352
|
* TBD.
|
|
353
353
|
* @param {object} graphicsData - TBD.
|
|
354
|
-
* @param {
|
|
354
|
+
* @param {GraphicsData} webGLData - TBD.
|
|
355
355
|
*/
|
|
356
356
|
export function buildCircle(graphicsData, webGLData) {
|
|
357
357
|
// need to convert points to a nice regular data
|
|
@@ -402,7 +402,7 @@ export function buildCircle(graphicsData, webGLData) {
|
|
|
402
402
|
/**
|
|
403
403
|
* TBD.
|
|
404
404
|
* @param {object} graphicsData - TBD.
|
|
405
|
-
* @param {
|
|
405
|
+
* @param {GraphicsData} webGLData - TBD.
|
|
406
406
|
*/
|
|
407
407
|
export function buildComplexPoly(graphicsData, webGLData) {
|
|
408
408
|
// TODO - no need to copy this as it gets turned into a Float32Array anyways..
|
|
@@ -446,7 +446,7 @@ export function buildComplexPoly(graphicsData, webGLData) {
|
|
|
446
446
|
/**
|
|
447
447
|
* TBD.
|
|
448
448
|
* @param {object} graphicsData - TBD.
|
|
449
|
-
* @param {
|
|
449
|
+
* @param {GraphicsData} webGLData - TBD.
|
|
450
450
|
* @returns {boolean} TBD.
|
|
451
451
|
*/
|
|
452
452
|
export function buildPoly(graphicsData, webGLData) {
|
|
@@ -11,7 +11,7 @@ export class RenderTexture extends Texture {
|
|
|
11
11
|
* TBD.
|
|
12
12
|
* @param {number} width - TBD.
|
|
13
13
|
* @param {number} height - TBD.
|
|
14
|
-
* @param renderer - TBD.
|
|
14
|
+
* @param {WebGLRenderer|CanvasRenderer} renderer - TBD.
|
|
15
15
|
* @param {number} scaleMode - TBD.
|
|
16
16
|
* @param {number} resolution - TBD.
|
|
17
17
|
*/
|
|
@@ -22,14 +22,12 @@ import {
|
|
|
22
22
|
import { remove } from '../canvas/pool';
|
|
23
23
|
import { isPowerOfTwo } from '../../util/math';
|
|
24
24
|
import { Point } from '../../geom/point';
|
|
25
|
-
import { Matrix } from '../../geom/matrix';
|
|
26
25
|
import { WebGLShaderManager } from './shader_manager';
|
|
27
26
|
import { WebGLSpriteBatch } from './sprite_batch';
|
|
28
27
|
import * as WebGLMaskManager from './mask_manager';
|
|
29
28
|
import { WebGLFilterManager } from './filter_manager';
|
|
30
29
|
import { WebGLStencilManager } from './stencil_manager';
|
|
31
30
|
import { WebGLBlendModeManager } from './blend_manager';
|
|
32
|
-
import { Game } from '../../core/game';
|
|
33
31
|
|
|
34
32
|
export class WebGLRenderer {
|
|
35
33
|
/**
|
|
@@ -121,6 +119,7 @@ export class WebGLRenderer {
|
|
|
121
119
|
|
|
122
120
|
/**
|
|
123
121
|
* TBD.
|
|
122
|
+
* @throws Error.
|
|
124
123
|
*/
|
|
125
124
|
initContext() {
|
|
126
125
|
const gl =
|
|
@@ -154,7 +153,7 @@ export class WebGLRenderer {
|
|
|
154
153
|
|
|
155
154
|
/**
|
|
156
155
|
* TBD.
|
|
157
|
-
* @param stage - TBD.
|
|
156
|
+
* @param {Stage} stage - TBD.
|
|
158
157
|
*/
|
|
159
158
|
render(stage) {
|
|
160
159
|
if (this.contextLost) {
|
|
@@ -176,9 +175,9 @@ export class WebGLRenderer {
|
|
|
176
175
|
|
|
177
176
|
/**
|
|
178
177
|
* TBD.
|
|
179
|
-
* @param displayObject - TBD.
|
|
180
|
-
* @param projection - TBD.
|
|
181
|
-
* @param buffer - TBD.
|
|
178
|
+
* @param {DisplayObject} displayObject - TBD.
|
|
179
|
+
* @param {Point} projection - TBD.
|
|
180
|
+
* @param {object} buffer - TBD.
|
|
182
181
|
* @param {Matrix} matrix - TBD.
|
|
183
182
|
*/
|
|
184
183
|
renderDisplayObject(displayObject, projection, buffer, matrix) {
|
|
@@ -222,7 +221,7 @@ export class WebGLRenderer {
|
|
|
222
221
|
|
|
223
222
|
/**
|
|
224
223
|
* TBD.
|
|
225
|
-
* @param texture - TBD.
|
|
224
|
+
* @param {BaseTexture} texture - TBD.
|
|
226
225
|
* @returns {boolean} TBD.
|
|
227
226
|
*/
|
|
228
227
|
updateTexture(texture) {
|
|
@@ -40,7 +40,7 @@ export class WebGLShaderManager {
|
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* TBD.
|
|
43
|
-
* @param attribs - TBD.
|
|
43
|
+
* @param {number[]} attribs - TBD.
|
|
44
44
|
*/
|
|
45
45
|
setAttribs(attribs) {
|
|
46
46
|
// reset temp state
|
|
@@ -68,7 +68,8 @@ export class WebGLShaderManager {
|
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* TBD.
|
|
71
|
-
* @param shader - TBD.
|
|
71
|
+
* @param {NormalShader} shader - TBD.
|
|
72
|
+
* @returns {boolean} TBD.
|
|
72
73
|
*/
|
|
73
74
|
setShader(shader) {
|
|
74
75
|
if (this._currentId === shader._UID) {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { AbstractFilter } from './abstract_filter';
|
|
2
2
|
import { NormalShader } from './shader/normal';
|
|
3
|
-
import { BaseTexture } from './base_texture';
|
|
4
|
-
import { Matrix } from '../../geom/matrix';
|
|
5
3
|
|
|
6
4
|
export class WebGLSpriteBatch {
|
|
7
5
|
/**
|
|
@@ -88,7 +86,7 @@ export class WebGLSpriteBatch {
|
|
|
88
86
|
|
|
89
87
|
/**
|
|
90
88
|
* TBD.
|
|
91
|
-
* @param sprite - TBD.
|
|
89
|
+
* @param {Image} sprite - TBD.
|
|
92
90
|
* @param {Matrix} matrix - TBD.
|
|
93
91
|
*/
|
|
94
92
|
render(sprite, matrix) {
|
|
@@ -28,8 +28,8 @@ export class WebGLStencilManager {
|
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* TBD.
|
|
31
|
-
* @param graphics - TBD.
|
|
32
|
-
* @param webGLData - TBD.
|
|
31
|
+
* @param {Graphics} graphics - TBD.
|
|
32
|
+
* @param {GraphicsData} webGLData - TBD.
|
|
33
33
|
* @param {object} renderSession - TBD.
|
|
34
34
|
*/
|
|
35
35
|
pushStencil(graphics, webGLData, renderSession) {
|
|
@@ -86,8 +86,8 @@ export class WebGLStencilManager {
|
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* TBD.
|
|
89
|
-
* @param graphics - TBD.
|
|
90
|
-
* @param webGLData - TBD.
|
|
89
|
+
* @param {Graphics} graphics - TBD.
|
|
90
|
+
* @param {GraphicsData} webGLData - TBD.
|
|
91
91
|
* @param {object} renderSession - TBD.
|
|
92
92
|
*/
|
|
93
93
|
bindGraphics(graphics, webGLData, renderSession) {
|
|
@@ -133,8 +133,8 @@ export class WebGLStencilManager {
|
|
|
133
133
|
|
|
134
134
|
/**
|
|
135
135
|
* TBD.
|
|
136
|
-
* @param graphics - TBD.
|
|
137
|
-
* @param webGLData - TBD.
|
|
136
|
+
* @param {Graphics} graphics - TBD.
|
|
137
|
+
* @param {GraphicsData} webGLData - TBD.
|
|
138
138
|
* @param {object} renderSession - TBD.
|
|
139
139
|
*/
|
|
140
140
|
popStencil(graphics, webGLData, renderSession) {
|