render(displayObject, matrix, clear)
This function will draw the display object to the RenderTexture.
In versions of Phaser prior to 2.4.0 the second parameter was a Phaser.Point object.
This is now a Matrix allowing you much more control over how the Display Object is rendered.
If you need to replicate the earlier behavior please use Phaser.RenderTexture.renderXY instead.
If you wish for the displayObject to be rendered taking its current scale, rotation and translation into account then either
pass null
, leave it undefined or pass displayObject.worldTransform
as the matrix value.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
displayObject | Phaser.Sprite | Phaser.Image | Phaser.Text | Phaser.BitmapText | Phaser.Group | The display object to render to this texture. | ||
matrix | Phaser.Matrix | <optional> | Optional matrix to apply to the display object before rendering. If null or undefined it will use the worldTransform matrix of the given display object. | |
clear | boolean | <optional> | false | If true the texture will be cleared before the display object is drawn. |
- Inherited From
- Source code: gameobjects/RenderTexture.js (Line 117)
Please login to continue.