Struct graphics::rectangle::Rectangle
[−]
[src]
pub struct Rectangle { pub color: Color, pub shape: Shape, pub border: Option<Border>, }
A filled rectangle
Fields
color | The rectangle color |
shape | The roundness of the rectangle |
border | The border |
Methods
impl Rectangle
fn new(color: Color) -> Rectangle
Creates a new rectangle.
fn new_round(color: Color, round_radius: Radius) -> Rectangle
Creates a new round rectangle.
fn new_border(color: Color, radius: Radius) -> Rectangle
Creates a new rectangle border.
fn new_round_border(color: Color, round_radius: Radius, border_radius: Radius) -> Rectangle
Creates a new round rectangle border.
fn color(self, value: Color) -> Self
Sets color.
fn shape(self, value: Shape) -> Self
Sets shape.
fn border(self, value: Border) -> Self
Sets border.
fn maybe_border(self, value: Option<Border>) -> Self
Sets optional border.
fn draw<R: Into<Rectangle>, G>(&self, rectangle: R, draw_state: &DrawState, transform: Matrix2d, g: &mut G) where G: Graphics
Draws the rectangle