pub struct FillSprite {
pub inner: Sprite,
pub color: i32,
pub width: AnimatedFloat,
pub height: AnimatedFloat,
}
Expand description
A sprite that displays a rectangle filled with a given color.
Fields
inner: Sprite
color: i32
width: AnimatedFloat
height: AnimatedFloat
Implementations
sourceimpl FillSprite
impl FillSprite
pub fn new(color: i32, width: f32, height: f32) -> Self
pub fn draw(&self, gfx: &Box<dyn Graphics>)
pub fn natural_width(&self) -> f32
pub fn natural_height(&self) -> f32
sourcepub fn set_size(&mut self, width: f32, height: f32) -> &Self
pub fn set_size(&mut self, width: f32, height: f32) -> &Self
Chainable convenience method to set the width and height. @returns This instance, for chaining.
pub fn on_update(&mut self, dt: f32)
Trait Implementations
sourceimpl AsRef<Sprite> for FillSprite
impl AsRef<Sprite> for FillSprite
sourceimpl Clone for FillSprite
impl Clone for FillSprite
sourcefn clone(&self) -> FillSprite
fn clone(&self) -> FillSprite
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FillSprite
impl Debug for FillSprite
sourceimpl Default for FillSprite
impl Default for FillSprite
sourcefn default() -> FillSprite
fn default() -> FillSprite
Returns the “default value” for a type. Read more
sourceimpl EntityManager<FillSprite> for Entity
impl EntityManager<FillSprite> for Entity
fn get(&self) -> Option<FillSprite>
Auto Trait Implementations
impl !RefUnwindSafe for FillSprite
impl !Send for FillSprite
impl !Sync for FillSprite
impl Unpin for FillSprite
impl !UnwindSafe for FillSprite
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
sourcefn into_color(self) -> To
fn into_color(self) -> To
Convert into color
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>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.