[][src]Trait kas::draw::DrawRounded

pub trait DrawRounded: Draw {
    pub fn rounded_line(
        &mut self,
        pass: Pass,
        p1: Vec2,
        p2: Vec2,
        radius: f32,
        col: Colour
    );
pub fn circle(
        &mut self,
        pass: Pass,
        rect: Quad,
        inner_radius: f32,
        col: Colour
    );
pub fn rounded_frame(
        &mut self,
        pass: Pass,
        outer: Quad,
        inner: Quad,
        inner_radius: f32,
        col: Colour
    ); }

Drawing commands for rounded shapes

This trait is an extension over Draw providing rounded shapes.

The primitives provided by this trait are partially transparent. If the implementation buffers draw commands, it should draw these primitives after solid primitives.

Required methods

pub fn rounded_line(
    &mut self,
    pass: Pass,
    p1: Vec2,
    p2: Vec2,
    radius: f32,
    col: Colour
)
[src]

Draw a line with rounded ends and uniform colour

This command draws a line segment between the points p1 and p2. Pixels within the given radius of this segment are drawn, resulting in rounded ends and width 2 * radius.

Note that for rectangular, axis-aligned lines, Draw::rect should be preferred.

pub fn circle(&mut self, pass: Pass, rect: Quad, inner_radius: f32, col: Colour)[src]

Draw a circle or oval of uniform colour

More generally, this shape is an axis-aligned oval which may be hollow.

The inner_radius parameter gives the inner radius relative to the outer radius: a value of 0.0 will result in the whole shape being painted, while 1.0 will result in a zero-width line on the outer edge.

pub fn rounded_frame(
    &mut self,
    pass: Pass,
    outer: Quad,
    inner: Quad,
    inner_radius: f32,
    col: Colour
)
[src]

Draw a frame with rounded corners and uniform colour

All drawing occurs within the outer rect and outside of the inner rect. Corners are circular (or more generally, ovular), centered on the inner corners.

The inner_radius parameter gives the inner radius relative to the outer radius: a value of 0.0 will result in the whole shape being painted, while 1.0 will result in a zero-width line on the outer edge. When inner_radius > 0, the frame will be visually thinner than the allocated area.

Loading content...

Implementors

Loading content...