Skip to content

Commit 8a7ead0

Browse files
committed
Frame.glTexture is a new property that maps to the WebGL Texture for the Frames Texture Source image. It's used internally by the renderer to avoid expensive object look-ups and is set automatically in the Frame constructor.
1 parent ea53e83 commit 8a7ead0

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ The Tint component documentation has been overhauled to explain these difference
8484
* `Scene.run` will now pass the optional `data` object in all cases, no matter if it's waking, resuming or starting a Scene (thanks @rook2pawn)
8585
* `ScenePlugin.start` and `ScenePlugin.restart` will now always queue the op with the Scene Manager, regardless of the state of the Scene, in order to avoid issues where plugins carry on running for a frame before closing down. Fix #3776 (thanks @jjalonso)
8686
* `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.
87+
* `Frame.glTexture` is a new property that maps to the WebGL Texture for the Frames Texture Source image. It's used internally by the renderer to avoid expensive object look-ups and is set automatically in the `Frame` constructor.
8788

8889
### Bug Fixes
8990

src/textures/Frame.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ var Frame = new Class({
6767
*/
6868
this.sourceIndex = sourceIndex;
6969

70+
/**
71+
* A reference to the Texture Source WebGL Texture that this Frame is using.
72+
*
73+
* @name Phaser.Textures.Frame#glTexture
74+
* @type {?WebGLTexture}
75+
* @default null
76+
* @since 3.11.0
77+
*/
78+
this.glTexture = this.source.glTexture;
79+
7080
/**
7181
* X position within the source image to cut from.
7282
*

0 commit comments

Comments
 (0)