textureMode

fun Window.textureMode(renderTexture: RenderTexture2D, block: Window.() -> Unit)

Executes a block of code while rendering to the specified RenderTexture2D.

This function starts rendering to the provided render texture, executes the given block of code, and then ends rendering to the render texture.

Parameters

renderTexture

The render texture to render to.

block

The block of code to execute while rendering to the render texture.