Phaser API Documentation

  Version: 
saveSnapshotTexture(key)

Description:

Stores a copy of this Videos snapshotTexture in the Texture Manager using the given key.

This texture is created when the snapshot or snapshotArea methods are called.

After doing this, any texture based Game Object, such as a Sprite, can use the contents of the snapshot by using the texture key:

var vid = this.add.video(0, 0, 'intro');

vid.snapshot();

vid.saveSnapshotTexture('doodle');

this.add.image(400, 300, 'doodle');

Updating the contents of the snapshotTexture, for example by calling snapshot again, will automatically update any Game Object that is using it as a texture. Calling saveSnapshotTexture again will not save another copy of the same texture, it will just rename the existing one.

By default it will create a single base texture. You can add frames to the texture by using the Texture.add method. After doing this, you can then allow Game Objects to use a specific frame.

Parameters:

name type description
key string

The unique key to store the texture as within the global Texture Manager.

Returns:
Description:

The Texture that was saved.

Since: 3.20.0