Struct piston_window::Rectangle
source · Expand description
A filled rectangle
Fields
color: [f32; 4]
The rectangle color
shape: Shape
The roundness of the rectangle
border: Option<Border>
The border
Implementations
sourceimpl Rectangle
impl Rectangle
sourcepub fn new_round(color: [f32; 4], round_radius: f64) -> Rectangle
pub fn new_round(color: [f32; 4], round_radius: f64) -> Rectangle
Creates a new rectangle with rounded corners.
sourcepub fn new_round_border(
color: [f32; 4],
round_radius: f64,
border_radius: f64
) -> Rectangle
pub fn new_round_border(
color: [f32; 4],
round_radius: f64,
border_radius: f64
) -> Rectangle
Creates a new rectangle border with rounded corners.
sourcepub fn maybe_border(self, value: Option<Border>) -> Rectangle
pub fn maybe_border(self, value: Option<Border>) -> Rectangle
Sets optional border.
sourcepub fn draw<R, G>(
&self,
rectangle: R,
draw_state: &DrawState,
transform: [[f64; 3]; 2],
g: &mut G
)where
R: Into<[f64; 4]>,
G: Graphics,
pub fn draw<R, G>(
&self,
rectangle: R,
draw_state: &DrawState,
transform: [[f64; 3]; 2],
g: &mut G
)where
R: Into<[f64; 4]>,
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
Trait Implementations
sourceimpl Colored for Rectangle
impl Colored for Rectangle
impl Copy for Rectangle
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
Sets
value
as a parameter of self
.