Phaser API Documentation

renderTexture(x, y, [width], [height])


Creates a new Render Texture Game Object and adds it to the Scene.

Note: This method will only be available if the Render Texture Game Object has been built into Phaser.

A Render Texture is a special texture that allows any number of Game Objects to be drawn to it. You can take many complex objects and draw them all to this one texture, which can they be used as the texture for other Game Object's. It's a way to generate dynamic textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads.


name type arguments Default description
x number

The horizontal position of this Game Object in the world.

y number

The vertical position of this Game Object in the world.

width number <optional> 32

The width of the Render Texture.

height number <optional> 32

The height of the Render Texture.


The Game Object that was created.