layer
fun Layer.layer(colorType: ColorType = this.colorType, multisample: BufferMultisample = BufferMultisample.Disabled, function: Layer.() -> Unit): Layer(source)
Creates a new layer within the current layer, allowing for hierarchical composition of drawings. The newly created layer inherits properties such as color type and multisample from the parent layer unless explicitly overridden. A custom lambda function can be applied to configure the new layer.
Return
The newly created layer, which is also added as a child of the parent layer.
Parameters
colorType
The color type for the new layer. Defaults to the color type of the parent layer.
multisample
Specifies the multisampling mode for the new layer to control antialiasing. Defaults to BufferMultisample.Disabled.
function
A configuration block where the properties and behavior of the new layer can be defined.