Phaser API Documentation

resize(width, [height])


Resizes the Render Texture to the new dimensions given.

If Render Texture was created from specific frame, only the size of the frame will be changed. The size of the source texture will not change.

If Render Texture was not created from specific frame, the following will happen:

In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture. In Canvas it will resize the underlying canvas element.

Both approaches will erase everything currently drawn to the Render Texture.

If the dimensions given are the same as those already being used, calling this method will do nothing.


name type arguments Default description
width number

The new width of the Render Texture.

height number <optional> width

The new height of the Render Texture. If not specified, will be set the same as the width.


This Render Texture.