Struct crankstart::sprite::Sprite
source · pub struct Sprite { /* private fields */ }
Implementations§
source§impl Sprite
impl Sprite
pub fn set_use_custom_draw(&mut self) -> Result<(), Error>
pub fn set_collision_response_type( &mut self, response_type: Option<Box<dyn SpriteCollider>> ) -> Result<(), Error>
pub fn get_bounds(&self) -> Result<PDRect, Error>
pub fn set_bounds(&self, bounds: &PDRect) -> Result<(), Error>
pub fn get_z_index(&self) -> Result<i16, Error>
pub fn set_z_index(&self, z_index: i16) -> Result<(), Error>
sourcepub fn get_image(&self) -> Result<Option<Ref<'_, Bitmap>>>
pub fn get_image(&self) -> Result<Option<Ref<'_, Bitmap>>>
Returns a reference to the bitmap assigned to the sprite, if any. Specifically,
returns Err if the inner data is already mutably borrowed; Ok(None) if no sprite has
been assigned; Ok(Some(Ref
pub fn set_image( &mut self, bitmap: Bitmap, flip: LCDBitmapFlip ) -> Result<(), Error>
pub fn set_tag(&mut self, tag: u8) -> Result<(), Error>
pub fn get_tag(&self) -> Result<u8, Error>
pub fn move_to(&mut self, x: f32, y: f32) -> Result<(), Error>
pub fn get_position(&self) -> Result<(f32, f32), Error>
pub fn set_collide_rect(&mut self, collide_rect: &PDRect) -> Result<(), Error>
pub fn move_with_collisions( &mut self, goal_x: f32, goal_y: f32 ) -> Result<(f32, f32, Collisions), Error>
pub fn mark_dirty(&mut self) -> Result<(), Error>
Trait Implementations§
source§impl PartialEq<Sprite> for Sprite
impl PartialEq<Sprite> for Sprite
impl Eq for Sprite
Auto Trait Implementations§
impl !RefUnwindSafe for Sprite
impl !Send for Sprite
impl !Sync for Sprite
impl Unpin for Sprite
impl !UnwindSafe for Sprite
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