Canvas:setTexture

Attaches one or more Textures to the Canvas. When rendering to the Canvas, everything will be drawn to all attached Textures. You can attach different layers of an array, cubemap, or volume texture, and also attach different mipmap levels of Textures.

Canvas:setTexture(...)

Arguments

NameTypeDescription
...*One or more Textures to attach to the Canvas.

Returns

Nothing

Notes

There are some restrictions on how textures can be attached:

To specify layers and mipmaps to attach, specify them after the Texture. You can also optionally wrap them in a table.

Example

Various ways to attach textures to a Canvas.

canvas:setTexture(textureA)
canvas:setTexture(textureA, textureB) -- Attach two textures
canvas:setTexture(textureA, layer, mipmap) -- Attach a specific layer and mipmap
canvas:setTexture(textureA, layer, textureB, layer) -- Attach specific layers
canvas:setTexture({ textureA, layer, mipmap }, textureB, { textureC, layer }) -- Tables
canvas:setTexture({ { textureA, layer, mipmap }, textureB, { textureC, layer } })

See also