Struct lux::graphics::Rectangle [] [src]

#[must_use = "Rectangles only contain context, and must be drawn with `fill()`, `stroke()`, or `fill_stroke()`"]
pub struct Rectangle<'a, C: 'a> {
    // some fields omitted
}

A Rectangle that can be drawn to the screen.

Methods

impl<'a, C> Rectangle<'a, C> where C: Canvas + 'a

fn fill(&mut self)

Fills the rectangle with a solid color.

fn stroke(&mut self)

Draws a border around the rectangle.

fn fill_and_stroke(&mut self)

Both fills and strokes the rectangle.

fn border<A: Color>(&mut self, border_size: Float, color: A) -> &mut Rectangle<'a, C>

Sets the size of the border. The border is drawn using the stroke() function.

Trait Implementations

impl<'a, C> Transform for Rectangle<'a, C>

fn current_matrix(&self) -> &[[Float; 4]; 4]

fn current_matrix_mut(&mut self) -> &mut [[Float; 4]; 4]

fn apply_matrix(&mut self, other: [[Float; 4]; 4]) -> &mut Self

fn translate(&mut self, dx: Float, dy: Float) -> &mut Self

fn scale(&mut self, sx: Float, sy: Float) -> &mut Self

fn shear(&mut self, sx: Float, sy: Float) -> &mut Self

fn rotate(&mut self, theta: Float) -> &mut Self

fn rotate_around(&mut self, point: (Float, Float), theta: Float) -> &mut Self

fn with_matrix<F, R>(&mut self, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_rotation<F, R>(&mut self, rotation: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_translate<F, R>(&mut self, dx: Float, dy: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_scale<F, R>(&mut self, scale_x: Float, scale_y: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_shear<F, R>(&mut self, sx: Float, sy: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

fn with_rotate_around<F, R>(&mut self, point: (Float, Float), theta: Float, f: F) -> R where F: FnOnce(&mut Self) -> R

impl<'a, C> Colored for Rectangle<'a, C>

fn get_color(&self) -> [Float; 4]

fn color<A: Color>(&mut self, color: A) -> &mut Self

fn with_color<F, C: Color>(&mut self, color: C, f: F) where F: FnOnce(&mut Self)