GetRenderTarget
Description
Creates or gets the rendertarget with the given name.
See GetRenderTargetEx for an advanced version of this function with more options.
Rendertargets are not garbage-collected, which means they will remain in memory until you disconnect. So make sure to avoid creating new ones unecessarily and re-use as many of your existing rendertargets as possible to avoid filling up all your memory.
Drawing rendertargets on themself can produce odd and unexpected results.
Calling this function is equivalent to
GetRenderTargetEx(name,
width, height,
RT_SIZE_NO_CHANGE,
MATERIAL_RT_DEPTH_SEPARATE,
bit.bor(2, 256),
0,
IMAGE_FORMAT_BGRA8888
)
Arguments
2 number width
The width of the render target, must be power of 2. If not set to PO2, the size will be automatically converted to the nearest PO2 size.
3 number height
The height of the render target, must be power of 2. If not set to PO2, the size will be automatically converted to the nearest PO2 size.
Returns
Example
Example usage of a render target
Example
Example usage of a render target with transparency/alpha channel