pub struct Shape<Unit, const TEXTURED: bool> { /* private fields */ }
Expand description
A tesselated shape.
This structure contains geometry that has been divided into triangles, ready to upload to the GPU. To render the shape, it must first be prepared.
Implementations§
source§impl<Unit: PixelScaling> Shape<Unit, false>
impl<Unit: PixelScaling> Shape<Unit, false>
sourcepub fn filled_circle(
radius: Unit,
color: Color,
origin: Origin<Unit>
) -> Shape<Unit, false>
pub fn filled_circle( radius: Unit, color: Color, origin: Origin<Unit> ) -> Shape<Unit, false>
Returns a circle that is filled solid with color
.
sourcepub fn stroked_circle(
radius: Unit,
origin: Origin<Unit>,
options: impl Into<StrokeOptions<Unit>>
) -> Shape<Unit, false>
pub fn stroked_circle( radius: Unit, origin: Origin<Unit>, options: impl Into<StrokeOptions<Unit>> ) -> Shape<Unit, false>
Returns a circle that is stroked with color
and options
.
sourcepub fn filled_rect(rect: Rect<Unit>, color: Color) -> Shape<Unit, false>
pub fn filled_rect(rect: Rect<Unit>, color: Color) -> Shape<Unit, false>
Returns a rectangle that is filled solid with color
.
sourcepub fn stroked_rect(
rect: Rect<Unit>,
options: impl Into<StrokeOptions<Unit>>
) -> Shape<Unit, false>
pub fn stroked_rect( rect: Rect<Unit>, options: impl Into<StrokeOptions<Unit>> ) -> Shape<Unit, false>
Returns a rectangle that has its outline stroked with color
and
options
.
sourcepub fn filled_round_rect(
rect: Rect<Unit>,
corner_radius: impl Into<CornerRadii<Unit>>,
color: Color
) -> Shape<Unit, false>
pub fn filled_round_rect( rect: Rect<Unit>, corner_radius: impl Into<CornerRadii<Unit>>, color: Color ) -> Shape<Unit, false>
Returns a rounded rectangle with the specified corner radii that is
filled solid with color
.
sourcepub fn stroked_round_rect(
rect: Rect<Unit>,
corner_radius: impl Into<CornerRadii<Unit>>,
options: impl Into<StrokeOptions<Unit>>
) -> Shape<Unit, false>
pub fn stroked_round_rect( rect: Rect<Unit>, corner_radius: impl Into<CornerRadii<Unit>>, options: impl Into<StrokeOptions<Unit>> ) -> Shape<Unit, false>
Returns a rounded rectangle with the specified corner radii that has its
outline stroked with color
and options
.
source§impl<Unit> Shape<Unit, true>
impl<Unit> Shape<Unit, true>
sourcepub fn prepare(
&self,
texture: &impl TextureSource,
graphics: &Graphics<'_>
) -> PreparedGraphic<Unit>
pub fn prepare( &self, texture: &impl TextureSource, graphics: &Graphics<'_> ) -> PreparedGraphic<Unit>
Uploads the shape to the GPU, applying texture
to the polygons.
Trait Implementations§
source§impl<Unit: PartialEq, const TEXTURED: bool> PartialEq for Shape<Unit, TEXTURED>
impl<Unit: PartialEq, const TEXTURED: bool> PartialEq for Shape<Unit, TEXTURED>
impl<Unit, const TEXTURED: bool> DrawableSource for Shape<Unit, TEXTURED>where
Unit: Copy,
impl<Unit, const TEXTURED: bool> ShapeSource<Unit, TEXTURED> for Shape<Unit, TEXTURED>where
Unit: Copy,
impl<Unit, const TEXTURED: bool> StructuralPartialEq for Shape<Unit, TEXTURED>
Auto Trait Implementations§
impl<Unit, const TEXTURED: bool> RefUnwindSafe for Shape<Unit, TEXTURED>where
Unit: RefUnwindSafe,
impl<Unit, const TEXTURED: bool> Send for Shape<Unit, TEXTURED>where
Unit: Send,
impl<Unit, const TEXTURED: bool> Sync for Shape<Unit, TEXTURED>where
Unit: Sync,
impl<Unit, const TEXTURED: bool> Unpin for Shape<Unit, TEXTURED>where
Unit: Unpin,
impl<Unit, const TEXTURED: bool> UnwindSafe for Shape<Unit, TEXTURED>where
Unit: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.