[−][src]Struct graphics::rectangle::Rectangle
A filled rectangle
Fields
color: Color
The rectangle color
shape: Shape
The roundness of the rectangle
border: Option<Border>
The border
Methods
impl Rectangle
[src]
impl Rectangle
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( | [src] |
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>( | [src] |
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>( | [src] |
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 Colored for Rectangle
[src]
impl Colored for Rectangle
fn mul_rgba( | [src] |
fn hue_rad(self, angle: ColorComponent) -> Self | [src] |
fn tint(self, f: ColorComponent) -> Self | [src] |
Mixes the current color with white. Read more
fn shade(self, f: ColorComponent) -> Self | [src] |
Mixes the current color with black. Read more
fn hue_deg(self, angle: ColorComponent) -> Self | [src] |
Rotates hue by degrees.
impl Copy for Rectangle
[src]
impl Copy for Rectangle
impl Clone for Rectangle
[src]
impl Clone for Rectangle
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |