Layer:setColor
EditSets 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
Name | Type | Default | Description |
r | number | The red component of the color. | |
g | number | The green component of the color. | |
b | number | The blue component of the color. | |
a | number | 1.0 | The alpha component of the color. |
Returns
Nothing
Arguments
Name | Type | Description |
t | table |
Returns
Nothing
Arguments
Name | Type | Default | Description |
hex | number | A hexcode. | |
a | number | 1.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.