DrawShaded

Trait DrawShaded 

Source
pub trait DrawShaded {
    // Required methods
    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 for 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§

Source

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.

Source

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.

Source

fn shaded_square_frame( &mut self, outer: Quad, inner: Quad, norm: (f32, f32), outer_col: Rgba, inner_col: Rgba, )

Add a shaded frame with square corners to the draw buffer

Source

fn shaded_round_frame( &mut self, outer: Quad, inner: Quad, norm: (f32, f32), col: Rgba, )

Add a shaded frame with rounded corners to the draw buffer

Implementations on Foreign Types§

Source§

impl<'a, DS: DrawSharedImpl> DrawShaded for DrawIface<'a, DS>
where DS::Draw: DrawShadedImpl,

Source§

fn shaded_square(&mut self, rect: Quad, norm: (f32, f32), col: Rgba)

Source§

fn shaded_circle(&mut self, rect: Quad, norm: (f32, f32), col: Rgba)

Source§

fn shaded_square_frame( &mut self, outer: Quad, inner: Quad, norm: (f32, f32), outer_col: Rgba, inner_col: Rgba, )

Source§

fn shaded_round_frame( &mut self, outer: Quad, inner: Quad, norm: (f32, f32), col: Rgba, )

Implementors§