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 | 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. |
x | number | <optional> |
The x position to draw the frame at. |
y | number | <optional> |
The y position to draw the frame at. |
alpha | number | <optional> |
The alpha to use. If not specified it uses the |
tint | number | <optional> |
WebGL only. The tint color to use. If not specified it uses the |
This Render Texture instance.