The Texture Add Event.
This event is dispatched by the Texture Manager when a texture is added to it.
Listen to this event from within a Scene using: this.textures.on('addtexture', listener)
.
name | type | description |
---|---|---|
key | string |
The key of the Texture that was added to the Texture Manager. |
texture | Phaser.Textures.Texture |
A reference to the Texture that was added to the Texture Manager. |
The Texture Load Error Event.
This event is dispatched by the Texture Manager when a texture it requested to load failed. This only happens when base64 encoded textures fail. All other texture types are loaded via the Loader Plugin.
Listen to this event from within a Scene using: this.textures.on('onerror', listener)
.
name | type | description |
---|---|---|
key | string |
The key of the Texture that failed to load into the Texture Manager. |
The Texture Load Event.
This event is dispatched by the Texture Manager when a texture has finished loading on it. This only happens for base64 encoded textures. All other texture types are loaded via the Loader Plugin.
Listen to this event from within a Scene using: this.textures.on('onload', listener)
.
This event is dispatched after the ADD
event.
name | type | description |
---|---|---|
key | string |
The key of the Texture that was loaded by the Texture Manager. |
texture | Phaser.Textures.Texture |
A reference to the Texture that was loaded by the Texture Manager. |
This internal event signifies that the Texture Manager is now ready and the Game can continue booting.
When a Phaser Game instance is booting for the first time, the Texture Manager has to wait on a couple of non-blocking async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game instance, which tells the Game to carry on booting.
The Texture Remove Event.
This event is dispatched by the Texture Manager when a texture is removed from it.
Listen to this event from within a Scene using: this.textures.on('removetexture', listener)
.
If you have any Game Objects still using the removed texture, they will start throwing errors the next time they try to render. Be sure to clear all use of the texture in this event handler.
name | type | description |
---|---|---|
key | string |
The key of the Texture that was removed from the Texture Manager. |