@vpmedia/phaser 1.105.0 → 1.107.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.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +238 -244
- package/dist/index.js.map +1 -1
- package/dist/phaser/core/animation.d.ts +2 -2
- package/dist/phaser/core/animation.d.ts.map +1 -1
- package/dist/phaser/core/animation_manager.d.ts +2 -2
- 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.map +1 -1
- package/dist/phaser/core/cache.d.ts +6 -6
- package/dist/phaser/core/cache.d.ts.map +1 -1
- package/dist/phaser/core/device.d.ts.map +1 -1
- package/dist/phaser/core/device_util.d.ts.map +1 -1
- package/dist/phaser/core/dom.d.ts +2 -2
- package/dist/phaser/core/dom.d.ts.map +1 -1
- package/dist/phaser/core/event_manager.d.ts.map +1 -1
- package/dist/phaser/core/factory.d.ts +1 -1
- package/dist/phaser/core/factory.d.ts.map +1 -1
- package/dist/phaser/core/frame.d.ts.map +1 -1
- package/dist/phaser/core/frame_data.d.ts.map +1 -1
- package/dist/phaser/core/frame_util.d.ts.map +1 -1
- package/dist/phaser/core/game.d.ts +1 -1
- package/dist/phaser/core/game.d.ts.map +1 -1
- package/dist/phaser/core/input.d.ts +3 -3
- package/dist/phaser/core/input.d.ts.map +1 -1
- package/dist/phaser/core/input_handler.d.ts +8 -8
- package/dist/phaser/core/input_handler.d.ts.map +1 -1
- package/dist/phaser/core/input_mouse.d.ts +8 -8
- package/dist/phaser/core/input_mouse.d.ts.map +1 -1
- package/dist/phaser/core/input_mspointer.d.ts +6 -6
- package/dist/phaser/core/input_mspointer.d.ts.map +1 -1
- package/dist/phaser/core/input_pointer.d.ts +3 -3
- package/dist/phaser/core/input_pointer.d.ts.map +1 -1
- package/dist/phaser/core/input_touch.d.ts +7 -7
- package/dist/phaser/core/input_touch.d.ts.map +1 -1
- package/dist/phaser/core/loader.d.ts +16 -6
- 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.map +1 -1
- package/dist/phaser/core/scale_manager.d.ts +5 -5
- package/dist/phaser/core/scale_manager.d.ts.map +1 -1
- package/dist/phaser/core/scene.d.ts +3 -3
- package/dist/phaser/core/scene.d.ts.map +1 -1
- package/dist/phaser/core/scene_manager.d.ts.map +1 -1
- package/dist/phaser/core/signal.d.ts +7 -7
- package/dist/phaser/core/signal.d.ts.map +1 -1
- package/dist/phaser/core/signal_binding.d.ts +1 -1
- package/dist/phaser/core/signal_binding.d.ts.map +1 -1
- package/dist/phaser/core/sound.d.ts +3 -3
- package/dist/phaser/core/sound.d.ts.map +1 -1
- package/dist/phaser/core/sound_manager.d.ts +1 -1
- package/dist/phaser/core/sound_manager.d.ts.map +1 -1
- package/dist/phaser/core/sound_sprite.d.ts.map +1 -1
- package/dist/phaser/core/stage.d.ts.map +1 -1
- package/dist/phaser/core/time.d.ts.map +1 -1
- package/dist/phaser/core/timer.d.ts +5 -5
- package/dist/phaser/core/timer.d.ts.map +1 -1
- package/dist/phaser/core/timer_event.d.ts.map +1 -1
- package/dist/phaser/core/tween.d.ts +1 -1
- package/dist/phaser/core/tween.d.ts.map +1 -1
- package/dist/phaser/core/tween_data.d.ts +1 -1
- package/dist/phaser/core/tween_data.d.ts.map +1 -1
- package/dist/phaser/core/tween_easing.d.ts.map +1 -1
- package/dist/phaser/core/tween_manager.d.ts +1 -1
- package/dist/phaser/core/tween_manager.d.ts.map +1 -1
- package/dist/phaser/core/world.d.ts.map +1 -1
- package/dist/phaser/display/bitmap_text.d.ts +3 -3
- package/dist/phaser/display/bitmap_text.d.ts.map +1 -1
- package/dist/phaser/display/button.d.ts +12 -11
- package/dist/phaser/display/button.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/phaser/display/canvas/renderer.d.ts +2 -2
- package/dist/phaser/display/canvas/renderer.d.ts.map +1 -1
- package/dist/phaser/display/canvas/tinter.d.ts +1 -1
- package/dist/phaser/display/canvas/tinter.d.ts.map +1 -1
- package/dist/phaser/display/canvas/util.d.ts +1 -1
- package/dist/phaser/display/canvas/util.d.ts.map +1 -1
- package/dist/phaser/display/display_object.d.ts +12 -21
- package/dist/phaser/display/display_object.d.ts.map +1 -1
- package/dist/phaser/display/graphics.d.ts +1 -1
- package/dist/phaser/display/graphics.d.ts.map +1 -1
- package/dist/phaser/display/graphics_data.d.ts.map +1 -1
- package/dist/phaser/display/graphics_data_util.d.ts.map +1 -1
- package/dist/phaser/display/group.d.ts +3 -3
- package/dist/phaser/display/group.d.ts.map +1 -1
- package/dist/phaser/display/image.d.ts +8 -8
- package/dist/phaser/display/image.d.ts.map +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 +8 -7
- package/dist/phaser/display/text.d.ts.map +1 -1
- package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -1
- package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/earcut.d.ts +5 -5
- package/dist/phaser/display/webgl/earcut.d.ts.map +1 -1
- package/dist/phaser/display/webgl/earcut_node.d.ts.map +1 -1
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts +3 -2
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/graphics.d.ts +4 -3
- package/dist/phaser/display/webgl/graphics.d.ts.map +1 -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 +2 -2
- package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/renderer.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/normal.d.ts +1 -1
- package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -1
- package/dist/phaser/display/webgl/shader_manager.d.ts +2 -1
- package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/sprite_batch.d.ts +2 -1
- package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
- package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
- package/dist/phaser/display/webgl/texture.d.ts.map +1 -1
- package/dist/phaser/display/webgl/texture_util.d.ts.map +1 -1
- package/dist/phaser/display/webgl/util.d.ts +8 -4
- package/dist/phaser/display/webgl/util.d.ts.map +1 -1
- package/dist/phaser/geom/circle.d.ts +1 -1
- package/dist/phaser/geom/circle.d.ts.map +1 -1
- package/dist/phaser/geom/ellipse.d.ts +1 -1
- package/dist/phaser/geom/ellipse.d.ts.map +1 -1
- package/dist/phaser/geom/line.d.ts +3 -3
- package/dist/phaser/geom/line.d.ts.map +1 -1
- package/dist/phaser/geom/matrix.d.ts +3 -3
- package/dist/phaser/geom/matrix.d.ts.map +1 -1
- package/dist/phaser/geom/point.d.ts.map +1 -1
- package/dist/phaser/geom/polygon.d.ts +1 -1
- package/dist/phaser/geom/polygon.d.ts.map +1 -1
- package/dist/phaser/geom/rectangle.d.ts +2 -2
- package/dist/phaser/geom/rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/rounded_rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/util/circle.d.ts +3 -3
- 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 +3 -3
- package/dist/phaser/geom/util/line.d.ts.map +1 -1
- package/dist/phaser/geom/util/matrix.d.ts +1 -1
- package/dist/phaser/geom/util/matrix.d.ts.map +1 -1
- package/dist/phaser/geom/util/point.d.ts +15 -15
- package/dist/phaser/geom/util/point.d.ts.map +1 -1
- package/dist/phaser/geom/util/polygon.d.ts +1 -1
- package/dist/phaser/geom/util/polygon.d.ts.map +1 -1
- package/dist/phaser/geom/util/rectangle.d.ts +5 -5
- package/dist/phaser/geom/util/rectangle.d.ts.map +1 -1
- package/dist/phaser/geom/util/rounded_rectangle.d.ts +1 -1
- package/dist/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
- package/dist/phaser/util/math.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/index.ts +8 -0
- package/src/phaser/core/animation.ts +16 -8
- package/src/phaser/core/animation_manager.ts +11 -5
- package/src/phaser/core/cache.ts +9 -8
- package/src/phaser/core/device.ts +24 -24
- package/src/phaser/core/device_util.ts +4 -2
- package/src/phaser/core/dom.ts +2 -2
- package/src/phaser/core/factory.ts +3 -5
- package/src/phaser/core/game.ts +21 -34
- package/src/phaser/core/input.ts +9 -5
- package/src/phaser/core/input_handler.ts +22 -7
- package/src/phaser/core/input_mouse.ts +8 -84
- package/src/phaser/core/input_mspointer.ts +22 -18
- package/src/phaser/core/input_pointer.ts +48 -48
- package/src/phaser/core/input_touch.ts +7 -7
- package/src/phaser/core/loader.ts +46 -31
- package/src/phaser/core/loader_parser.ts +34 -8
- package/src/phaser/core/scale_manager.ts +5 -5
- package/src/phaser/core/scene.ts +5 -5
- package/src/phaser/core/signal.ts +15 -9
- package/src/phaser/core/signal_binding.ts +8 -1
- package/src/phaser/core/sound.ts +18 -21
- package/src/phaser/core/sound_manager.ts +3 -3
- package/src/phaser/core/sound_sprite.ts +7 -7
- package/src/phaser/core/stage.ts +6 -6
- package/src/phaser/core/time.ts +28 -28
- package/src/phaser/core/timer.ts +4 -4
- package/src/phaser/core/tween.ts +31 -9
- package/src/phaser/core/tween_data.ts +2 -2
- package/src/phaser/core/tween_manager.ts +7 -7
- package/src/phaser/display/bitmap_text.ts +6 -6
- package/src/phaser/display/button.ts +38 -19
- package/src/phaser/display/canvas/buffer.ts +4 -4
- package/src/phaser/display/canvas/renderer.ts +2 -2
- package/src/phaser/display/canvas/util.ts +21 -13
- package/src/phaser/display/display_object.ts +17 -31
- package/src/phaser/display/graphics.ts +9 -9
- package/src/phaser/display/graphics_data.ts +19 -11
- package/src/phaser/display/group.ts +8 -8
- package/src/phaser/display/image.ts +26 -20
- package/src/phaser/display/sprite_util.ts +16 -4
- package/src/phaser/display/text.ts +9 -9
- package/src/phaser/display/webgl/blend_manager.ts +2 -2
- package/src/phaser/display/webgl/earcut.ts +31 -6
- package/src/phaser/display/webgl/fast_sprite_batch.ts +19 -17
- package/src/phaser/display/webgl/filter_manager.ts +3 -3
- package/src/phaser/display/webgl/filter_texture.ts +4 -4
- package/src/phaser/display/webgl/graphics.ts +11 -3
- package/src/phaser/display/webgl/graphics_data.ts +9 -9
- package/src/phaser/display/webgl/render_texture.ts +9 -3
- package/src/phaser/display/webgl/shader/complex.ts +5 -5
- package/src/phaser/display/webgl/shader/fast.ts +6 -6
- package/src/phaser/display/webgl/shader/normal.ts +11 -11
- package/src/phaser/display/webgl/shader/primitive.ts +5 -5
- package/src/phaser/display/webgl/shader/strip.ts +5 -5
- package/src/phaser/display/webgl/shader_manager.ts +12 -11
- package/src/phaser/display/webgl/sprite_batch.ts +18 -17
- package/src/phaser/display/webgl/stencil_manager.ts +18 -6
- package/src/phaser/display/webgl/texture.ts +6 -1
- package/src/phaser/display/webgl/util.ts +17 -4
- package/src/phaser/geom/circle.ts +1 -1
- package/src/phaser/geom/ellipse.ts +1 -1
- package/src/phaser/geom/line.ts +2 -2
- package/src/phaser/geom/matrix.ts +3 -3
- package/src/phaser/geom/polygon.ts +1 -1
- package/src/phaser/geom/rectangle.ts +2 -2
- package/src/phaser/geom/util/circle.ts +8 -3
- package/src/phaser/geom/util/line.ts +9 -2
- package/src/phaser/geom/util/matrix.ts +1 -1
- package/src/phaser/geom/util/point.ts +23 -16
- package/src/phaser/geom/util/polygon.ts +1 -1
- package/src/phaser/geom/util/rectangle.ts +13 -6
- package/src/phaser/geom/util/rounded_rectangle.ts +1 -1
|
@@ -30,8 +30,8 @@ export class Group extends DisplayObject {
|
|
|
30
30
|
*/
|
|
31
31
|
constructor(
|
|
32
32
|
game: import('../core/game.js').Game,
|
|
33
|
-
parent: DisplayObject = null,
|
|
34
|
-
name: string = null,
|
|
33
|
+
parent: DisplayObject | null = null,
|
|
34
|
+
name: string | null = null,
|
|
35
35
|
addToStage: boolean = false
|
|
36
36
|
) {
|
|
37
37
|
super(game);
|
|
@@ -80,7 +80,7 @@ export class Group extends DisplayObject {
|
|
|
80
80
|
* @param {boolean} destroyChildren - Whether to destroy children as well.
|
|
81
81
|
* @param {boolean} soft - Whether to perform a soft destroy (leaving the group in the parent's children list).
|
|
82
82
|
*/
|
|
83
|
-
destroy(destroyChildren: boolean = true, soft: boolean = false) {
|
|
83
|
+
override destroy(destroyChildren: boolean = true, soft: boolean = false) {
|
|
84
84
|
if (this.game === null || this.ignoreDestroy) {
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
@@ -93,7 +93,7 @@ export class Group extends DisplayObject {
|
|
|
93
93
|
if (this.parent) {
|
|
94
94
|
this.parent.removeChild(this);
|
|
95
95
|
}
|
|
96
|
-
this.game = null
|
|
96
|
+
this.game = null!;
|
|
97
97
|
this.exists = false;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -253,12 +253,12 @@ export class Group extends DisplayObject {
|
|
|
253
253
|
/**
|
|
254
254
|
* Updates the Z indices of all children in this group before the update cycle.
|
|
255
255
|
*/
|
|
256
|
-
preUpdate() {
|
|
256
|
+
override preUpdate() {
|
|
257
257
|
if (this.pendingDestroy) {
|
|
258
258
|
this.destroy();
|
|
259
259
|
return;
|
|
260
260
|
}
|
|
261
|
-
if (!this.exists || !this.parent
|
|
261
|
+
if (!this.exists || !this.parent?.exists) {
|
|
262
262
|
this.renderOrderID = -1;
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
@@ -270,7 +270,7 @@ export class Group extends DisplayObject {
|
|
|
270
270
|
/**
|
|
271
271
|
* Updates all children in this group during the update cycle.
|
|
272
272
|
*/
|
|
273
|
-
update() {
|
|
273
|
+
override update() {
|
|
274
274
|
let i = this.children.length;
|
|
275
275
|
while (i) {
|
|
276
276
|
i -= 1;
|
|
@@ -281,7 +281,7 @@ export class Group extends DisplayObject {
|
|
|
281
281
|
/**
|
|
282
282
|
* Updates all children in this group after the update cycle.
|
|
283
283
|
*/
|
|
284
|
-
postUpdate() {
|
|
284
|
+
override postUpdate() {
|
|
285
285
|
for (let i = 0; i < this.children.length; i += 1) {
|
|
286
286
|
this.children[i].postUpdate();
|
|
287
287
|
}
|
|
@@ -35,7 +35,13 @@ export class Image extends DisplayObject {
|
|
|
35
35
|
* @param {string | number | Texture} key - The texture key or texture to use.
|
|
36
36
|
* @param {string | number} frame - The frame identifier (name or index) to use.
|
|
37
37
|
*/
|
|
38
|
-
constructor(
|
|
38
|
+
constructor(
|
|
39
|
+
game: import('../core/game.js').Game,
|
|
40
|
+
x: number,
|
|
41
|
+
y: number,
|
|
42
|
+
key: string | number | Texture | null,
|
|
43
|
+
frame: string | number | null = 0
|
|
44
|
+
) {
|
|
39
45
|
super(game);
|
|
40
46
|
/** @type {number} */
|
|
41
47
|
this.type = IMAGE;
|
|
@@ -78,11 +84,11 @@ export class Image extends DisplayObject {
|
|
|
78
84
|
/**
|
|
79
85
|
* Destroys this image and cleans up resources.
|
|
80
86
|
*/
|
|
81
|
-
destroy() {
|
|
82
|
-
this.game = null
|
|
87
|
+
override destroy() {
|
|
88
|
+
this.game = null!;
|
|
83
89
|
this.key = null;
|
|
84
90
|
this.data = null;
|
|
85
|
-
this.texture = null
|
|
91
|
+
this.texture = null!;
|
|
86
92
|
this.tint = 0xff_ff_ff;
|
|
87
93
|
this.cachedTint = -1;
|
|
88
94
|
this.tintedTexture = null;
|
|
@@ -91,23 +97,23 @@ export class Image extends DisplayObject {
|
|
|
91
97
|
if (this.events) {
|
|
92
98
|
this.events.destroy();
|
|
93
99
|
}
|
|
94
|
-
this.events = null
|
|
100
|
+
this.events = null!;
|
|
95
101
|
if (this.animations) {
|
|
96
102
|
this.animations.destroy();
|
|
97
103
|
}
|
|
98
|
-
this.animations = null
|
|
104
|
+
this.animations = null!;
|
|
99
105
|
super.destroy();
|
|
100
106
|
}
|
|
101
107
|
|
|
102
108
|
/**
|
|
103
109
|
* Called before the update cycle for this image.
|
|
104
110
|
*/
|
|
105
|
-
preUpdate() {
|
|
111
|
+
override preUpdate() {
|
|
106
112
|
if (this.pendingDestroy) {
|
|
107
113
|
this.destroy();
|
|
108
114
|
return;
|
|
109
115
|
}
|
|
110
|
-
if (!this.exists || !this.parent
|
|
116
|
+
if (!this.exists || !this.parent?.exists) {
|
|
111
117
|
this.renderOrderID = -1;
|
|
112
118
|
return;
|
|
113
119
|
}
|
|
@@ -131,9 +137,9 @@ export class Image extends DisplayObject {
|
|
|
131
137
|
* @param {string | number | null | undefined} frame - The frame identifier (name or index) to use.
|
|
132
138
|
* @param {boolean} stopAnimation - Whether to stop the animation when changing textures.
|
|
133
139
|
*/
|
|
134
|
-
loadTexture(key: string | number | Texture, frame: string | number | null = 0, stopAnimation: boolean = true) {
|
|
140
|
+
loadTexture(key: string | number | Texture | null, frame: string | number | null = 0, stopAnimation: boolean = true) {
|
|
135
141
|
if (key === PENDING_ATLAS) {
|
|
136
|
-
key = frame;
|
|
142
|
+
key = frame ?? 0;
|
|
137
143
|
frame = 0;
|
|
138
144
|
} else {
|
|
139
145
|
frame = frame || 0;
|
|
@@ -216,11 +222,11 @@ export class Image extends DisplayObject {
|
|
|
216
222
|
|
|
217
223
|
/**
|
|
218
224
|
* Resizes the frame of this image.
|
|
219
|
-
* @param {DisplayObject}
|
|
225
|
+
* @param {DisplayObject} _parent - The parent display object.
|
|
220
226
|
* @param {number} width - The new width of the frame.
|
|
221
227
|
* @param {number} height - The new height of the frame.
|
|
222
228
|
*/
|
|
223
|
-
resizeFrame(
|
|
229
|
+
resizeFrame(_parent: DisplayObject, width: number, height: number) {
|
|
224
230
|
this.texture.frame.resize(width, height);
|
|
225
231
|
this.texture.setFrame(this.texture.frame);
|
|
226
232
|
}
|
|
@@ -326,7 +332,7 @@ export class Image extends DisplayObject {
|
|
|
326
332
|
* Gets the width of this image.
|
|
327
333
|
* @returns {number} The width in pixels.
|
|
328
334
|
*/
|
|
329
|
-
get width() {
|
|
335
|
+
override get width() {
|
|
330
336
|
return this.scale.x * this.texture.frame.width;
|
|
331
337
|
}
|
|
332
338
|
|
|
@@ -334,7 +340,7 @@ export class Image extends DisplayObject {
|
|
|
334
340
|
* Sets the width of this image.
|
|
335
341
|
* @param {number} value - The new width in pixels.
|
|
336
342
|
*/
|
|
337
|
-
set width(value: number) {
|
|
343
|
+
override set width(value: number) {
|
|
338
344
|
this.scale.x = value / this.texture.frame.width;
|
|
339
345
|
this._width = value;
|
|
340
346
|
}
|
|
@@ -343,7 +349,7 @@ export class Image extends DisplayObject {
|
|
|
343
349
|
* Gets the height of this image.
|
|
344
350
|
* @returns {number} The height in pixels.
|
|
345
351
|
*/
|
|
346
|
-
get height() {
|
|
352
|
+
override get height() {
|
|
347
353
|
return this.scale.y * this.texture.frame.height;
|
|
348
354
|
}
|
|
349
355
|
|
|
@@ -351,7 +357,7 @@ export class Image extends DisplayObject {
|
|
|
351
357
|
* Sets the height of this image.
|
|
352
358
|
* @param {number} value - The new height in pixels.
|
|
353
359
|
*/
|
|
354
|
-
set height(value: number) {
|
|
360
|
+
override set height(value: number) {
|
|
355
361
|
this.scale.y = value / this.texture.frame.height;
|
|
356
362
|
this._height = value;
|
|
357
363
|
}
|
|
@@ -383,7 +389,7 @@ export class Image extends DisplayObject {
|
|
|
383
389
|
* @param {import('../geom/matrix.js').Matrix} matrix - The transformation matrix to use.
|
|
384
390
|
* @returns {Rectangle} The bounds rectangle of this image.
|
|
385
391
|
*/
|
|
386
|
-
getBounds(matrix: import('../geom/matrix.js').Matrix = null) {
|
|
392
|
+
override getBounds(matrix: import('../geom/matrix.js').Matrix | null = null) {
|
|
387
393
|
return getBounds(this, matrix);
|
|
388
394
|
}
|
|
389
395
|
|
|
@@ -391,7 +397,7 @@ export class Image extends DisplayObject {
|
|
|
391
397
|
* Gets the local bounds of this image.
|
|
392
398
|
* @returns {Rectangle} The local bounds rectangle of this image.
|
|
393
399
|
*/
|
|
394
|
-
getLocalBounds() {
|
|
400
|
+
override getLocalBounds() {
|
|
395
401
|
return getLocalBounds(this);
|
|
396
402
|
}
|
|
397
403
|
|
|
@@ -400,7 +406,7 @@ export class Image extends DisplayObject {
|
|
|
400
406
|
* @param {object} renderSession - The WebGL rendering session.
|
|
401
407
|
* @param {import('../geom/matrix.js').Matrix} matrix - The transformation matrix to use.
|
|
402
408
|
*/
|
|
403
|
-
renderWebGL(renderSession: any, matrix: import('../geom/matrix.js').Matrix = null) {
|
|
409
|
+
override renderWebGL(renderSession: any, matrix: import('../geom/matrix.js').Matrix | null = null) {
|
|
404
410
|
renderWebGL(this, renderSession, matrix);
|
|
405
411
|
}
|
|
406
412
|
|
|
@@ -409,7 +415,7 @@ export class Image extends DisplayObject {
|
|
|
409
415
|
* @param {object} renderSession - The Canvas rendering session.
|
|
410
416
|
* @param {import('../geom/matrix.js').Matrix} matrix - The transformation matrix to use.
|
|
411
417
|
*/
|
|
412
|
-
renderCanvas(renderSession: any, matrix: import('../geom/matrix.js').Matrix = null) {
|
|
418
|
+
override renderCanvas(renderSession: any, matrix: import('../geom/matrix.js').Matrix | null = null) {
|
|
413
419
|
renderCanvas(this, renderSession, matrix);
|
|
414
420
|
}
|
|
415
421
|
}
|
|
@@ -8,7 +8,11 @@ import { getTintedTexture } from './canvas/tinter.js';
|
|
|
8
8
|
* @param {import('./webgl/texture.js').Texture} texture - The new texture to set.
|
|
9
9
|
* @param {boolean} destroyBase - Whether to destroy the base texture.
|
|
10
10
|
*/
|
|
11
|
-
export const setTexture = (
|
|
11
|
+
export const setTexture = (
|
|
12
|
+
target: import('./image.js').Image,
|
|
13
|
+
texture: import('./webgl/texture.js').Texture,
|
|
14
|
+
destroyBase: boolean = false
|
|
15
|
+
) => {
|
|
12
16
|
if (destroyBase) {
|
|
13
17
|
target.texture.baseTexture.destroy();
|
|
14
18
|
}
|
|
@@ -24,7 +28,7 @@ export const setTexture = (target: import('./image.js').Image, texture: import('
|
|
|
24
28
|
* @param {object} matrix - The transformation matrix.
|
|
25
29
|
* @returns {import('../geom/rectangle.js').Rectangle} The bounds rectangle.
|
|
26
30
|
*/
|
|
27
|
-
export const getBounds = (target: import('./image.js').Image, matrix: any = null) => {
|
|
31
|
+
export const getBounds = (target: import('./image.js').Image, matrix: any | null = null) => {
|
|
28
32
|
// TODO verify
|
|
29
33
|
if (target.currentBounds) {
|
|
30
34
|
return target.currentBounds;
|
|
@@ -127,7 +131,11 @@ export const getLocalBounds = (target: import('./image.js').Image) => {
|
|
|
127
131
|
* @param {object} renderSession - The render session object.
|
|
128
132
|
* @param {import('../geom/matrix.js').Matrix | null | undefined} matrix - The transformation matrix.
|
|
129
133
|
*/
|
|
130
|
-
export const renderWebGL = (
|
|
134
|
+
export const renderWebGL = (
|
|
135
|
+
target: import('./image.js').Image,
|
|
136
|
+
renderSession: any,
|
|
137
|
+
matrix: import('../geom/matrix.js').Matrix | null | undefined = null
|
|
138
|
+
) => {
|
|
131
139
|
// if the sprite is not visible or the alpha is 0 then no need to render this element
|
|
132
140
|
if (!target.visible || target.alpha <= 0 || !target.renderable) {
|
|
133
141
|
return;
|
|
@@ -176,7 +184,11 @@ export const renderWebGL = (target: import('./image.js').Image, renderSession: a
|
|
|
176
184
|
* @param {object} renderSession - The render session object.
|
|
177
185
|
* @param {import('../geom/matrix.js').Matrix | null | undefined} matrix - The transformation matrix.
|
|
178
186
|
*/
|
|
179
|
-
export const renderCanvas = (
|
|
187
|
+
export const renderCanvas = (
|
|
188
|
+
target: import('./image.js').Image,
|
|
189
|
+
renderSession: any,
|
|
190
|
+
matrix: import('../geom/matrix.js').Matrix | null | undefined = null
|
|
191
|
+
) => {
|
|
180
192
|
// If the sprite is not visible or the alpha is 0 then no need to render this element
|
|
181
193
|
if (
|
|
182
194
|
!target.visible ||
|
|
@@ -77,7 +77,7 @@ export class Text extends Image {
|
|
|
77
77
|
/**
|
|
78
78
|
* Destroys this text object and cleans up resources.
|
|
79
79
|
*/
|
|
80
|
-
destroy() {
|
|
80
|
+
override destroy() {
|
|
81
81
|
this.texture.destroy(true);
|
|
82
82
|
remove(this);
|
|
83
83
|
this.canvas = null;
|
|
@@ -128,7 +128,7 @@ export class Text extends Image {
|
|
|
128
128
|
* @param {boolean} update - Whether to update the text immediately.
|
|
129
129
|
* @returns {Text} This Text object for chaining.
|
|
130
130
|
*/
|
|
131
|
-
setStyle(style: any = null, update: boolean = false) {
|
|
131
|
+
setStyle(style: any | null = null, update: boolean = false) {
|
|
132
132
|
style = JSON.parse(JSON.stringify(style)) || {};
|
|
133
133
|
style.font = style.font || 'bold 20pt Arial';
|
|
134
134
|
style.backgroundColor = style.backgroundColor || null;
|
|
@@ -878,7 +878,7 @@ export class Text extends Image {
|
|
|
878
878
|
* Renders this text object using WebGL.
|
|
879
879
|
* @param {object} renderSession - The render session to use.
|
|
880
880
|
*/
|
|
881
|
-
renderWebGL(renderSession: any) {
|
|
881
|
+
override renderWebGL(renderSession: any) {
|
|
882
882
|
if (this.dirty) {
|
|
883
883
|
this.updateText();
|
|
884
884
|
this.dirty = false;
|
|
@@ -890,7 +890,7 @@ export class Text extends Image {
|
|
|
890
890
|
* Renders this text object using Canvas.
|
|
891
891
|
* @param {object} renderSession - The render session to use.
|
|
892
892
|
*/
|
|
893
|
-
renderCanvas(renderSession: any) {
|
|
893
|
+
override renderCanvas(renderSession: any) {
|
|
894
894
|
if (this.dirty) {
|
|
895
895
|
this.updateText();
|
|
896
896
|
this.dirty = false;
|
|
@@ -1044,7 +1044,7 @@ export class Text extends Image {
|
|
|
1044
1044
|
* @param {import('../geom/matrix.js').Matrix} matrix - The transformation matrix to use.
|
|
1045
1045
|
* @returns {Rectangle} The bounds of this text object.
|
|
1046
1046
|
*/
|
|
1047
|
-
getBounds(matrix: import('../geom/matrix.js').Matrix = null) {
|
|
1047
|
+
override getBounds(matrix: import('../geom/matrix.js').Matrix | null = null) {
|
|
1048
1048
|
if (this.dirty) {
|
|
1049
1049
|
this.updateText();
|
|
1050
1050
|
this.dirty = false;
|
|
@@ -1521,7 +1521,7 @@ export class Text extends Image {
|
|
|
1521
1521
|
* Gets the width of this object.
|
|
1522
1522
|
* @returns {number} The width in pixels.
|
|
1523
1523
|
*/
|
|
1524
|
-
get width() {
|
|
1524
|
+
override get width() {
|
|
1525
1525
|
if (this.dirty) {
|
|
1526
1526
|
this.updateText();
|
|
1527
1527
|
this.dirty = false;
|
|
@@ -1533,7 +1533,7 @@ export class Text extends Image {
|
|
|
1533
1533
|
* Sets the width of this object.
|
|
1534
1534
|
* @param {number} value - The new width to set in pixels.
|
|
1535
1535
|
*/
|
|
1536
|
-
set width(value: number) {
|
|
1536
|
+
override set width(value: number) {
|
|
1537
1537
|
this.scale.x = value / this.texture.frame.width;
|
|
1538
1538
|
this._width = value;
|
|
1539
1539
|
}
|
|
@@ -1542,7 +1542,7 @@ export class Text extends Image {
|
|
|
1542
1542
|
* Gets the height of this object.
|
|
1543
1543
|
* @returns {number} The height in pixels.
|
|
1544
1544
|
*/
|
|
1545
|
-
get height() {
|
|
1545
|
+
override get height() {
|
|
1546
1546
|
if (this.dirty) {
|
|
1547
1547
|
this.updateText();
|
|
1548
1548
|
this.dirty = false;
|
|
@@ -1554,7 +1554,7 @@ export class Text extends Image {
|
|
|
1554
1554
|
* Sets the height of this object.
|
|
1555
1555
|
* @param {number} value - The new height to set in pixels.
|
|
1556
1556
|
*/
|
|
1557
|
-
set height(value: number) {
|
|
1557
|
+
override set height(value: number) {
|
|
1558
1558
|
this.scale.y = value / this.texture.frame.height;
|
|
1559
1559
|
this._height = value;
|
|
1560
1560
|
}
|
|
@@ -107,7 +107,7 @@ export function zOrder(x: number, y: number, minX: number, minY: number, size: n
|
|
|
107
107
|
* @param {number} minY - The minimum y-coordinate of the bounding box.
|
|
108
108
|
* @param {number} size - The size of the bounding box.
|
|
109
109
|
*/
|
|
110
|
-
export function indexCurve(start: any, minX: number, minY: number, size: number) {
|
|
110
|
+
export function indexCurve(start: any, minX: number = 0, minY: number = 0, size: number = 0) {
|
|
111
111
|
let p = start;
|
|
112
112
|
do {
|
|
113
113
|
if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, size);
|
|
@@ -147,7 +147,16 @@ export function getLeftmost(start: any) {
|
|
|
147
147
|
* @param {number} py - TBD.
|
|
148
148
|
* @returns {object} TBD.
|
|
149
149
|
*/
|
|
150
|
-
export function pointInTriangle(
|
|
150
|
+
export function pointInTriangle(
|
|
151
|
+
ax: number,
|
|
152
|
+
ay: number,
|
|
153
|
+
bx: number,
|
|
154
|
+
by: number,
|
|
155
|
+
cx: number,
|
|
156
|
+
cy: number,
|
|
157
|
+
px: number,
|
|
158
|
+
py: number
|
|
159
|
+
) {
|
|
151
160
|
return (
|
|
152
161
|
(cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&
|
|
153
162
|
(ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&
|
|
@@ -339,7 +348,7 @@ export function isEar(ear: any) {
|
|
|
339
348
|
* @param {number} size - TBD.
|
|
340
349
|
* @returns {boolean} TBD.
|
|
341
350
|
*/
|
|
342
|
-
export function isEarHashed(ear: any, minX: number, minY: number, size: number) {
|
|
351
|
+
export function isEarHashed(ear: any, minX: number = 0, minY: number = 0, size: number = 0) {
|
|
343
352
|
const a = ear.prev;
|
|
344
353
|
const b = ear;
|
|
345
354
|
const c = ear.next;
|
|
@@ -517,6 +526,7 @@ export function eliminateHoles(data: any, holeIndices: any, outerNode: any, dim:
|
|
|
517
526
|
start = holeIndices[i] * dim;
|
|
518
527
|
end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
|
|
519
528
|
list = linkedList(data, start, end, dim, false);
|
|
529
|
+
if (!list) continue;
|
|
520
530
|
if (list === list.next) list.steiner = true;
|
|
521
531
|
queue.push(getLeftmost(list));
|
|
522
532
|
}
|
|
@@ -566,7 +576,14 @@ export function cureLocalIntersections(start: any, triangles: any, dim: number)
|
|
|
566
576
|
* @param {number} minY - The minimum y-coordinate of the bounding box.
|
|
567
577
|
* @param {number} size - The size of the bounding box.
|
|
568
578
|
*/
|
|
569
|
-
export function splitEarcut(
|
|
579
|
+
export function splitEarcut(
|
|
580
|
+
start: any,
|
|
581
|
+
triangles: any,
|
|
582
|
+
dim: number,
|
|
583
|
+
minX: number = 0,
|
|
584
|
+
minY: number = 0,
|
|
585
|
+
size: number = 0
|
|
586
|
+
) {
|
|
570
587
|
// look for a valid diagonal that divides the polygon into two
|
|
571
588
|
let a = start;
|
|
572
589
|
do {
|
|
@@ -599,7 +616,15 @@ export function splitEarcut(start: any, triangles: any, dim: number, minX: numbe
|
|
|
599
616
|
* @param {number} size - The size of the bounding box.
|
|
600
617
|
* @param {object} pass - The pass information for triangulation.
|
|
601
618
|
*/
|
|
602
|
-
export function earcutLinked(
|
|
619
|
+
export function earcutLinked(
|
|
620
|
+
ear: any,
|
|
621
|
+
triangles: any,
|
|
622
|
+
dim: number,
|
|
623
|
+
minX?: number,
|
|
624
|
+
minY?: number,
|
|
625
|
+
size?: number,
|
|
626
|
+
pass?: any
|
|
627
|
+
) {
|
|
603
628
|
if (!ear) return;
|
|
604
629
|
// interlink polygon nodes in z-order
|
|
605
630
|
if (!pass && size) indexCurve(ear, minX, minY, size);
|
|
@@ -652,7 +677,7 @@ export function triangulate(data: any, holeIndices: any, dim: number) {
|
|
|
652
677
|
const hasHoles = holeIndices && holeIndices.length;
|
|
653
678
|
const outerLen = hasHoles ? holeIndices[0] * dim : data.length;
|
|
654
679
|
let outerNode = linkedList(data, 0, outerLen, dim, true);
|
|
655
|
-
const triangles = [];
|
|
680
|
+
const triangles: number[] = [];
|
|
656
681
|
if (!outerNode) return triangles;
|
|
657
682
|
let minX;
|
|
658
683
|
let minY;
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
+
import type { IdentifiedWebGLRenderingContext } from './util.js';
|
|
2
|
+
|
|
1
3
|
export class FastSpriteBatch {
|
|
2
4
|
[key: string]: any;
|
|
3
|
-
vertSize!: any;
|
|
4
|
-
maxSize!: any;
|
|
5
|
-
size!: any;
|
|
6
|
-
vertices!: any;
|
|
7
|
-
indices!: any;
|
|
8
|
-
vertexBuffer!: any;
|
|
9
|
-
indexBuffer!: any;
|
|
10
|
-
lastIndexCount!: any;
|
|
11
|
-
drawing!: any;
|
|
12
|
-
currentBatchSize!: any;
|
|
13
|
-
currentBaseTexture!: any;
|
|
14
|
-
currentBlendMode!: any;
|
|
15
|
-
renderSession!: any;
|
|
16
|
-
shader!: any;
|
|
17
|
-
matrix!: any;
|
|
5
|
+
vertSize!: any;
|
|
6
|
+
maxSize!: any;
|
|
7
|
+
size!: any;
|
|
8
|
+
vertices!: any;
|
|
9
|
+
indices!: any;
|
|
10
|
+
vertexBuffer!: any;
|
|
11
|
+
indexBuffer!: any;
|
|
12
|
+
lastIndexCount!: any;
|
|
13
|
+
drawing!: any;
|
|
14
|
+
currentBatchSize!: any;
|
|
15
|
+
currentBaseTexture!: any;
|
|
16
|
+
currentBlendMode!: any;
|
|
17
|
+
renderSession!: any;
|
|
18
|
+
shader!: any;
|
|
19
|
+
matrix!: any;
|
|
18
20
|
/**
|
|
19
21
|
* Creates a new FastSpriteBatch instance.
|
|
20
22
|
* @param {WebGLRenderingContext & { id: number }} gl - The WebGL rendering context.
|
|
21
23
|
*/
|
|
22
|
-
constructor(gl) {
|
|
24
|
+
constructor(gl: IdentifiedWebGLRenderingContext) {
|
|
23
25
|
this.vertSize = 10;
|
|
24
26
|
this.maxSize = 6000; // Math.pow(2, 16) / this.vertSize;
|
|
25
27
|
this.size = this.maxSize;
|
|
@@ -54,7 +56,7 @@ matrix!: any;
|
|
|
54
56
|
* Sets the WebGL context for this batch.
|
|
55
57
|
* @param {WebGLRenderingContext & { id: number }} gl - The WebGL rendering context.
|
|
56
58
|
*/
|
|
57
|
-
setContext(gl) {
|
|
59
|
+
setContext(gl: IdentifiedWebGLRenderingContext) {
|
|
58
60
|
this.gl = gl;
|
|
59
61
|
// create a couple of buffers
|
|
60
62
|
this.vertexBuffer = gl.createBuffer();
|
|
@@ -2,10 +2,10 @@ import { SCALE_LINEAR } from '../../core/const.js';
|
|
|
2
2
|
|
|
3
3
|
export class FilterTexture {
|
|
4
4
|
[key: string]: any;
|
|
5
|
-
gl!: any;
|
|
6
|
-
frameBuffer!: any;
|
|
7
|
-
texture!: any;
|
|
8
|
-
renderBuffer!: any;
|
|
5
|
+
gl!: any;
|
|
6
|
+
frameBuffer!: any;
|
|
7
|
+
texture!: any;
|
|
8
|
+
renderBuffer!: any;
|
|
9
9
|
/**
|
|
10
10
|
* Creates a new FilterTexture instance.
|
|
11
11
|
* @param {WebGLRenderingContext} gl - The WebGL rendering context.
|
|
@@ -3,6 +3,7 @@ import { Point } from '../../geom/point.js';
|
|
|
3
3
|
import { hex2rgb } from '../../util/math.js';
|
|
4
4
|
import { triangulate } from './earcut.js';
|
|
5
5
|
import { GraphicsData } from './graphics_data.js';
|
|
6
|
+
import type { IdentifiedWebGLRenderingContext } from './util.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Updates the graphics data for WebGL rendering.
|
|
@@ -269,7 +270,14 @@ export const buildRectangle = (graphicsData: any, webGLData: GraphicsData) => {
|
|
|
269
270
|
* @param {number} toY - The ending y-coordinate.
|
|
270
271
|
* @returns {number[]} The calculated points for the quadratic bezier curve.
|
|
271
272
|
*/
|
|
272
|
-
export const quadraticBezierCurve = (
|
|
273
|
+
export const quadraticBezierCurve = (
|
|
274
|
+
fromX: number,
|
|
275
|
+
fromY: number,
|
|
276
|
+
cpX: number,
|
|
277
|
+
cpY: number,
|
|
278
|
+
toX: number,
|
|
279
|
+
toY: number
|
|
280
|
+
) => {
|
|
273
281
|
let xa;
|
|
274
282
|
let ya;
|
|
275
283
|
let xb;
|
|
@@ -278,7 +286,7 @@ export const quadraticBezierCurve = (fromX: number, fromY: number, cpX: number,
|
|
|
278
286
|
let y;
|
|
279
287
|
const n = 20;
|
|
280
288
|
const points = [];
|
|
281
|
-
const getPt = (n1, n2, perc) => {
|
|
289
|
+
const getPt = (n1: number, n2: number, perc: number) => {
|
|
282
290
|
const diff = n2 - n1;
|
|
283
291
|
return n1 + diff * perc;
|
|
284
292
|
};
|
|
@@ -487,7 +495,7 @@ export const buildPoly = (graphicsData: any, webGLData: GraphicsData) => {
|
|
|
487
495
|
* @param {import('../graphics.js').Graphics} graphics - The graphics object to update.
|
|
488
496
|
* @param {WebGLRenderingContext & { id: number }} gl - The WebGL rendering context.
|
|
489
497
|
*/
|
|
490
|
-
export const updateGraphics = (graphics: import('../graphics.js').Graphics, gl) => {
|
|
498
|
+
export const updateGraphics = (graphics: import('../graphics.js').Graphics, gl: IdentifiedWebGLRenderingContext) => {
|
|
491
499
|
const stencilBufferLimit = getStencilBufferLimit();
|
|
492
500
|
// get the contexts graphics object
|
|
493
501
|
let webGL = graphics._webGL[gl.id];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export class GraphicsData {
|
|
2
2
|
[key: string]: any;
|
|
3
|
-
gl!: any;
|
|
4
|
-
color!: any;
|
|
5
|
-
points!: any;
|
|
6
|
-
indices!: any;
|
|
7
|
-
buffer!: any;
|
|
8
|
-
indexBuffer!: any;
|
|
9
|
-
mode!: any;
|
|
10
|
-
alpha!: any;
|
|
11
|
-
dirty!: any;
|
|
3
|
+
gl!: any;
|
|
4
|
+
color!: any;
|
|
5
|
+
points!: any;
|
|
6
|
+
indices!: any;
|
|
7
|
+
buffer!: any;
|
|
8
|
+
indexBuffer!: any;
|
|
9
|
+
mode!: any;
|
|
10
|
+
alpha!: any;
|
|
11
|
+
dirty!: any;
|
|
12
12
|
/**
|
|
13
13
|
* Creates a new GraphicsData instance.
|
|
14
14
|
* @param {WebGLRenderingContext} gl - The WebGL rendering context.
|
|
@@ -26,7 +26,13 @@ export class RenderTexture extends Texture {
|
|
|
26
26
|
* @param {number} scaleMode - The scale mode to use.
|
|
27
27
|
* @param {number} resolution - The resolution to use.
|
|
28
28
|
*/
|
|
29
|
-
constructor(
|
|
29
|
+
constructor(
|
|
30
|
+
width: number,
|
|
31
|
+
height: number,
|
|
32
|
+
renderer: import('./renderer.js').WebGLRenderer | import('../canvas/renderer.js').CanvasRenderer,
|
|
33
|
+
scaleMode: number,
|
|
34
|
+
resolution: number = 1
|
|
35
|
+
) {
|
|
30
36
|
const w = width || 100;
|
|
31
37
|
const h = height || 100;
|
|
32
38
|
const res = resolution || 1;
|
|
@@ -104,14 +110,14 @@ export class RenderTexture extends Texture {
|
|
|
104
110
|
* @returns {string} The base64 string representation.
|
|
105
111
|
*/
|
|
106
112
|
getBase64() {
|
|
107
|
-
return this.getCanvas()
|
|
113
|
+
return this.getCanvas()?.toDataURL() ?? '';
|
|
108
114
|
}
|
|
109
115
|
|
|
110
116
|
/**
|
|
111
117
|
* Gets the canvas element for this render texture.
|
|
112
118
|
* @returns {HTMLCanvasElement} The canvas element.
|
|
113
119
|
*/
|
|
114
|
-
getCanvas() {
|
|
120
|
+
getCanvas(): HTMLCanvasElement | null {
|
|
115
121
|
// TODO
|
|
116
122
|
return null;
|
|
117
123
|
}
|
|
@@ -5,11 +5,11 @@ import { compileProgram } from '../util.js';
|
|
|
5
5
|
|
|
6
6
|
export class ComplexPrimitiveShader {
|
|
7
7
|
[key: string]: any;
|
|
8
|
-
gl!: any;
|
|
9
|
-
_UID!: any;
|
|
10
|
-
program!: any;
|
|
11
|
-
fragmentSrc!: any;
|
|
12
|
-
vertexSrc!: any;
|
|
8
|
+
gl!: any;
|
|
9
|
+
_UID!: any;
|
|
10
|
+
program!: any;
|
|
11
|
+
fragmentSrc!: any;
|
|
12
|
+
vertexSrc!: any;
|
|
13
13
|
/**
|
|
14
14
|
* Creates a new ComplexShader instance.
|
|
15
15
|
* @param {WebGLRenderingContext} gl - The WebGL rendering context.
|
|
@@ -5,12 +5,12 @@ import { compileProgram } from '../util.js';
|
|
|
5
5
|
|
|
6
6
|
export class FastShader {
|
|
7
7
|
[key: string]: any;
|
|
8
|
-
gl!: any;
|
|
9
|
-
_UID!: any;
|
|
10
|
-
program!: any;
|
|
11
|
-
textureCount!: any;
|
|
12
|
-
fragmentSrc!: any;
|
|
13
|
-
vertexSrc!: any;
|
|
8
|
+
gl!: any;
|
|
9
|
+
_UID!: any;
|
|
10
|
+
program!: any;
|
|
11
|
+
textureCount!: any;
|
|
12
|
+
fragmentSrc!: any;
|
|
13
|
+
vertexSrc!: any;
|
|
14
14
|
/**
|
|
15
15
|
* Creates a new FastShader instance.
|
|
16
16
|
* @param {WebGLRenderingContext} gl - The WebGL rendering context.
|