Struct dunge::LayerBuilder
source · pub struct LayerBuilder<'l, 'd, V, T> { /* private fields */ }
Expand description
The layer builder. It creates a configured Layer
.
Implementations§
source§impl<'l, 'd, V, T> Builder<'l, 'd, V, T>
impl<'l, 'd, V, T> Builder<'l, 'd, V, T>
sourcepub fn with_clear_color<C>(self, color: C) -> Selfwhere
C: IntoLinear,
pub fn with_clear_color<C>(self, color: C) -> Selfwhere C: IntoLinear,
Sets clear color for the layer.
It takes a color parameter, which must implement the IntoLinear
trait.
Don’t set this setting if you don’t want to fill
the previous layer (or frame) with some color.
Or set to clear the current buffer if a layer is already drawn
into the frame by calling commit_in_frame
.
Example
let color = Srgba([20, 30, 40, 255]);
let mut layer = frame
.texture_layer()
.with_clear_color(color)
.start();
To clear a layer with a transparent color, it is enough to pass ()
as a parameter.
Example
let mut layer = frame
.texture_layer()
.with_clear_color(())
.start();
sourcepub fn with_clear_depth(self) -> Self
pub fn with_clear_depth(self) -> Self
Sets the flag to clear the depth buffer or not for the layer.