Draws the Texture Frame to the Render Texture at the given position.
Textures are referenced by their string-based keys, as stored in the Texture Manager.
var rt = this.add.renderTexture(0, 0, 800, 600);
rt.drawFrame(key, frame);
You can optionally provide a position, alpha and tint value to apply to the frame before it is drawn.
Calling this method will cause a batch flush, so if you've got a stack of things to draw
in a tight loop, try using the draw
method instead.
If you need to draw a Sprite to this Render Texture, use the draw
method instead.
name | type | arguments | Default | description |
---|---|---|---|---|
key | string |
The key of the texture to be used, as stored in the Texture Manager. |
||
frame | string | number | <optional> |
The name or index of the frame within the Texture. Set to |
|
x | number | <optional> | 0 |
The x position to draw the frame at. |
y | number | <optional> | 0 |
The y position to draw the frame at. |
alpha | number | <optional> | 1 |
The alpha value. Only used when drawing Texture Frames to this texture. |
tint | number | <optional> | 0xffffff |
The tint color value. Only used when drawing Texture Frames to this texture. WebGL only. |
This Render Texture instance.