Skip to content

Commit 17112ec

Browse files
committed
Tileset.glTexture is a new property that maps to the WebGL Texture for the Tileset image. It's used internally by the renderer to avoid expensive object look-ups and is set automatically in the Tileset.setImage method.
1 parent 0ac0bc1 commit 17112ec

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/tilemaps/Tileset.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,16 @@ var Tileset = new Class({
128128
*/
129129
this.image = null;
130130

131+
/**
132+
* The gl texture used by the WebGL renderer.
133+
*
134+
* @name Phaser.Tilemaps.Tileset#glTexture
135+
* @type {?WebGLTexture}
136+
* @readOnly
137+
* @since 3.11.0
138+
*/
139+
this.glTexture = null;
140+
131141
/**
132142
* The number of tile rows in the the tileset.
133143
*
@@ -276,6 +286,8 @@ var Tileset = new Class({
276286
{
277287
this.image = texture;
278288

289+
this.glTexture = texture.get().source.glTexture;
290+
279291
this.updateTileData(this.image.source[0].width, this.image.source[0].height);
280292

281293
return this;

0 commit comments

Comments
 (0)