Layer:setColor

Edit

Sets the color of the layer. This will tint the contents of its texture. It can be used to fade the layer without re-rendering its texture, which is especially useful for layers created with the static option.




Arguments

NameTypeDefaultDescription
rnumber The red component of the color.
gnumber The green component of the color.
bnumber The blue component of the color.
anumber1.0 The alpha component of the color.

Returns

Nothing

Arguments

NameTypeDescription
ttable

Returns

Nothing

Arguments

NameTypeDefaultDescription
hexnumber A hexcode.
anumber1.0 The alpha component of the color.

Returns

Nothing

Notes

The default color is white (all 1s).

Not every headset system supports layer colors. See the layerColor property of lovr.headset.getFeatures to check for support.

See also