Class: RenderTexture

Phaser. RenderTexture

Phaser.RenderTexture

new RenderTexture(game, key, width, height, key, scaleMode, resolution)

A RenderTexture is a special texture that allows any displayObject to be rendered to it. It allows you to take many complex objects and render them down into a single quad (on WebGL) which can then be used to texture other display objects with. A way of generating textures at run-time.

Parameters:
Name Type Argument Default Description
game Phaser.Game

Current game instance.

key string

Internal Phaser reference key for the render texture.

width number <optional>
100

The width of the render texture.

height number <optional>
100

The height of the render texture.

key string <optional>
''

The key of the RenderTexture in the Cache, if stored there.

scaleMode number <optional>
Phaser.scaleModes.DEFAULT

One of the Phaser.scaleModes consts.

resolution number <optional>
1

The resolution of the texture being generated.

Source:

Extends

  • PIXI.RenderTexture

Members

game

Properties:
Name Type Description
game Phaser.Game

A reference to the currently running game.

Source:

key

Properties:
Name Type Description
key string

The key of the RenderTexture in the Cache, if stored there.

Source:

matrix

Properties:
Name Type Description
matrix PIXI.Matrix

The matrix that is applied when display objects are rendered to this RenderTexture.

Source:

type

Properties:
Name Type Description
type number

Base Phaser object type.

Source:

Methods

render(displayObject, position, clear)

This function will draw the display object to the texture.

Parameters:
Name Type Description
displayObject Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Group

The display object to render to this texture.

position Phaser.Point

A Point object containing the position to render the display object at.

clear boolean

If true the texture will be cleared before the display object is drawn.

Source:

renderXY(displayObject, x, y, clear)

This function will draw the display object to the texture.

Parameters:
Name Type Description
displayObject Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Group

The display object to render to this texture.

x number

The x position to render the object at.

y number

The y position to render the object at.

clear boolean

If true the texture will be cleared before the display object is drawn.

Source:
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Wed Oct 22 2014 21:46:05 GMT+0100 (BST) using the DocStrap template.