pub struct PatternSprite {
pub inner: Sprite,
pub texture: Option<Rc<dyn Texture>>,
pub width: AnimatedFloat,
pub height: AnimatedFloat,
}
Expand description
A resizable sprite that tiles a texture over its area.
Fields
inner: Sprite
texture: Option<Rc<dyn Texture>>
The texture being displayed, or None if none.
width: AnimatedFloat
height: AnimatedFloat
Implementations
sourceimpl PatternSprite
impl PatternSprite
pub fn new(texture: Option<Rc<dyn Texture>>, 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 PatternSprite
impl AsRef<Sprite> for PatternSprite
sourceimpl Clone for PatternSprite
impl Clone for PatternSprite
sourcefn clone(&self) -> PatternSprite
fn clone(&self) -> PatternSprite
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 PatternSprite
impl Debug for PatternSprite
sourceimpl Default for PatternSprite
impl Default for PatternSprite
sourcefn default() -> PatternSprite
fn default() -> PatternSprite
Returns the “default value” for a type. Read more
sourceimpl EntityManager<PatternSprite> for Entity
impl EntityManager<PatternSprite> for Entity
fn get(&self) -> Option<PatternSprite>
Auto Trait Implementations
impl !RefUnwindSafe for PatternSprite
impl !Send for PatternSprite
impl !Sync for PatternSprite
impl Unpin for PatternSprite
impl !UnwindSafe for PatternSprite
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
.