Struct graphics::rectangle::Rectangle [−][src]
A filled rectangle
Fields
color: ColorThe rectangle color
shape: ShapeThe roundness of the rectangle
border: Option<Border>The border
Implementations
impl Rectangle[src]
pub fn new(color: Color) -> Rectangle[src]
Creates a new rectangle.
pub fn new_round(color: Color, round_radius: Radius) -> Rectangle[src]
Creates a new rectangle with rounded corners.
pub fn new_border(color: Color, radius: Radius) -> Rectangle[src]
Creates a new rectangle border.
pub fn new_round_border(
color: Color,
round_radius: Radius,
border_radius: Radius
) -> Rectangle[src]
color: Color,
round_radius: Radius,
border_radius: Radius
) -> Rectangle
Creates a new rectangle border with rounded corners.
pub fn color(self, value: Color) -> Self[src]
Sets color.
pub fn shape(self, value: Shape) -> Self[src]
Sets shape of the corners.
pub fn border(self, value: Border) -> Self[src]
Sets border properties.
pub fn maybe_border(self, value: Option<Border>) -> Self[src]
Sets optional border.
pub fn draw<R: Into<Rectangle>, G>(
&self,
rectangle: R,
draw_state: &DrawState,
transform: Matrix2d,
g: &mut G
) where
G: Graphics, [src]
&self,
rectangle: R,
draw_state: &DrawState,
transform: Matrix2d,
g: &mut G
) where
G: Graphics,
Draws the rectangle using the default method.
rectangle defines the rectangle’s location and dimensions,
draw_state draw state, draw_state::Default::default() can be used
as a default, transform is the transformation matrix, g is the
Graphics implementation, that is used to actually draw the rectangle.s
pub fn draw_tri<R: Into<Rectangle>, G>(
&self,
rectangle: R,
draw_state: &DrawState,
transform: Matrix2d,
g: &mut G
) where
G: Graphics, [src]
&self,
rectangle: R,
draw_state: &DrawState,
transform: Matrix2d,
g: &mut G
) where
G: Graphics,
Draws the rectangle using triangulation.
This is the default implementation of draw() that will be used if G
does not redefine Graphics::rectangle().
Trait Implementations
impl Clone for Rectangle[src]
impl Colored for Rectangle[src]
fn mul_rgba(
self,
r: ColorComponent,
g: ColorComponent,
b: ColorComponent,
a: ColorComponent
) -> Self[src]
self,
r: ColorComponent,
g: ColorComponent,
b: ColorComponent,
a: ColorComponent
) -> Self
fn hue_rad(self, angle: ColorComponent) -> Self[src]
fn tint(self, f: ColorComponent) -> Self[src]
fn shade(self, f: ColorComponent) -> Self[src]
fn hue_deg(self, angle: ColorComponent) -> Self[src]
impl Copy for Rectangle[src]
Auto Trait Implementations
impl RefUnwindSafe for Rectangle
impl Send for Rectangle
impl Sync for Rectangle
impl Unpin for Rectangle
impl UnwindSafe for Rectangle
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,