Trait kas_theme::DrawShaded
source · pub trait DrawShaded {
fn shaded_square(&mut self, rect: Quad, norm: (f32, f32), col: Rgba);
fn shaded_circle(&mut self, rect: Quad, norm: (f32, f32), col: Rgba);
fn shaded_square_frame(
&mut self,
outer: Quad,
inner: Quad,
norm: (f32, f32),
outer_col: Rgba,
inner_col: Rgba
);
fn shaded_round_frame(
&mut self,
outer: Quad,
inner: Quad,
norm: (f32, f32),
col: Rgba
);
}
Expand description
Extension trait providing shaded drawing over DrawIface
All methods draw some feature.
Methods are parameterised via a pair of normals, (inner, outer)
, which
specify the surface normal direction at inner and outer edges of the feature
respectively (with interpolation between these edges). These have values
from the closed range [-1, 1]
, where -1 points towards the inside of the
feature, 1 points away from the feature, and 0 is perpendicular to the
screen towards the viewer.
Required Methods§
sourcefn shaded_square(&mut self, rect: Quad, norm: (f32, f32), col: Rgba)
fn shaded_square(&mut self, rect: Quad, norm: (f32, f32), col: Rgba)
Add a shaded square to the draw buffer
For shading purposes, the mid-point is considered the inner edge.
sourcefn shaded_circle(&mut self, rect: Quad, norm: (f32, f32), col: Rgba)
fn shaded_circle(&mut self, rect: Quad, norm: (f32, f32), col: Rgba)
Add a shaded circle to the draw buffer
For shading purposes, the mid-point is considered the inner edge.