pub trait DrawShadedImpl: DrawImpl {
// Required methods
fn shaded_square(
&mut self,
pass: PassId,
rect: Quad,
norm: (f32, f32),
col: Rgba,
);
fn shaded_circle(
&mut self,
pass: PassId,
rect: Quad,
norm: (f32, f32),
col: Rgba,
);
fn shaded_square_frame(
&mut self,
pass: PassId,
outer: Quad,
inner: Quad,
norm: (f32, f32),
outer_col: Rgba,
inner_col: Rgba,
);
fn shaded_round_frame(
&mut self,
pass: PassId,
outer: Quad,
inner: Quad,
norm: (f32, f32),
col: Rgba,
);
}
Expand description
Extended draw interface for DrawIface
providing shaded drawing
This trait is an extension over DrawImpl
providing solid shaded shapes.
Some drawing primitives (the “round” ones) are partially transparent. If the implementation buffers draw commands, it should draw these primitives after solid primitives.
Methods are parameterised via a pair of normals, (inner, outer)
. These may
have values from the closed range [-1, 1]
, where -1 points inwards,
0 is perpendicular to the screen towards the viewer, and 1 points outwards.
Required Methods§
Sourcefn shaded_square(
&mut self,
pass: PassId,
rect: Quad,
norm: (f32, f32),
col: Rgba,
)
fn shaded_square( &mut self, pass: PassId, rect: Quad, norm: (f32, f32), col: Rgba, )
Add a shaded square to the draw buffer
Sourcefn shaded_circle(
&mut self,
pass: PassId,
rect: Quad,
norm: (f32, f32),
col: Rgba,
)
fn shaded_circle( &mut self, pass: PassId, rect: Quad, norm: (f32, f32), col: Rgba, )
Add a shaded circle to the draw buffer