new RenderTexture(game, key, width, height)
A RenderTexture is a special texture that allows any displayObject to be rendered to it.
Parameters:
Name | Type | Description |
---|---|---|
game |
Phaser.Game | Current game instance. |
key |
string | Asset key for the render texture. |
width |
number | the width of the render texture. |
height |
number | the height of the render texture. |
- Source:
Members
-
frame
-
- Source:
Properties:
Name Type Description frame
PIXI.Rectangle The frame for this texture.
-
game
-
- Source:
Properties:
Name Type Description game
Phaser.Game A reference to the currently running game.
-
height
-
- Source:
Properties:
Name Type Description height
number the height.
-
indetityMatrix
-
- Source:
Properties:
Name Type Description indetityMatrix
PIXI.mat3 Matrix object.
-
name
-
- Source:
Properties:
Name Type Description name
string the name of the object.
-
type
-
- Source:
Properties:
Name Type Description type
number Base Phaser object type.
-
width
-
- Source:
Properties:
Name Type Description width
number the width.
Methods
-
render(displayObject, position, clear, renderHidden)
-
This function will draw the display object to the texture. If the display object is a Group or has children it will draw all children as well.
Parameters:
Name Type Argument Default Description displayObject
DisplayObject The display object to render this texture on.
position
Phaser.Point <optional>
Where to draw the display object.
clear
boolean <optional>
false If true the texture will be cleared before the displayObject is drawn.
renderHidden
boolean <optional>
false If true displayObjects that have their visible property set to false will still be rendered.
- Source:
-
renderXY(displayObject, x, y, clear, renderHidden)
-
This function will draw the display object to the texture at the given x/y coordinates. If the display object is a Group or has children it will draw all children as well.
Parameters:
Name Type Argument Default Description displayObject
DisplayObject The display object to render this texture on.
x
number The x coordinate to draw the display object at.
y
number The y coordinate to draw the display object at.
clear
boolean <optional>
false If true the texture will be cleared before the displayObject is drawn.
renderHidden
boolean <optional>
false If true displayObjects that have their visible property set to false will still be rendered.
- Source:
-
resize()
-
Resizes the RenderTexture.
- Source: