pub struct SpriteDrawable {
pub position: Point<i32>,
pub sprite_id: SpriteId,
pub last_state_change: Instant,
pub animation_type: AnimationInfo,
}Fields§
§position: Point<i32>§sprite_id: SpriteId§last_state_change: Instant§animation_type: AnimationInfoTrait Implementations§
Source§impl Clone for SpriteDrawable
impl Clone for SpriteDrawable
Source§fn clone(&self) -> SpriteDrawable
fn clone(&self) -> SpriteDrawable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpriteDrawable
impl Debug for SpriteDrawable
Source§impl Drawable for SpriteDrawable
impl Drawable for SpriteDrawable
fn size(&self, sprites: &SpriteRegistry) -> Result<(u16, u16), DrawError>
fn as_single_pointed_mut(&mut self) -> Option<&mut dyn SinglePointed>
Source§fn draw(
&mut self,
sprites: &SpriteRegistry,
) -> Result<BasicDrawCreator, DrawError>
fn draw( &mut self, sprites: &SpriteRegistry, ) -> Result<BasicDrawCreator, DrawError>
The Output of this function will be used to render to the terminal
Source§fn bounding_iv(&self, sprites: &SpriteRegistry) -> Option<UpdateIntervalCreator>
fn bounding_iv(&self, sprites: &SpriteRegistry) -> Option<UpdateIntervalCreator>
Return an UpdateIntervalCreator Read more
fn on_screen_select( &mut self, selected_screen: TargetScreen, ) -> Result<(), DrawError>
Source§fn on_any_key_press(
&mut self,
msg: KeyMessage,
screen: TargetScreen,
) -> Result<(), DrawError>
fn on_any_key_press( &mut self, msg: KeyMessage, screen: TargetScreen, ) -> Result<(), DrawError>
gets triggered, if any key with any selected screen has been pressed.
To know, if the drawable is on this screen:
1. use the on_key_press function
2. pass the screen_id of the screen that the drawable is on to the drawable and check manually
Source§fn on_key_press(&mut self, msg: KeyMessage) -> Result<(), DrawError>
fn on_key_press(&mut self, msg: KeyMessage) -> Result<(), DrawError>
gets triggered, if a key has been pressed and the screen, which the drawable is on is selected.
If you want react to global keypresses use the trait function ‘on_any_keypress’
Source§fn on_mousekey_press(&mut self, msg: MouseMessage) -> Result<(), DrawError>
fn on_mousekey_press(&mut self, msg: MouseMessage) -> Result<(), DrawError>
gets triggered, if a mouse_key has been pressed and the screen, which the drawable is on is selected.
If you want react to global keypresses use the trait function ‘on_any_keypress’
Source§fn on_any_mousekey_press(
&mut self,
msg: MouseMessage,
screen: TargetScreen,
) -> Result<(), DrawError>
fn on_any_mousekey_press( &mut self, msg: MouseMessage, screen: TargetScreen, ) -> Result<(), DrawError>
gets triggered, if any mouse_key with any selected screen has been pressed.
To know, if the drawable is on this screen:
1. use the on_mousekey_press function
2. pass the screen_id of the screen that the drawable is on to the drawable and check manually
fn get_top_left(&mut self) -> Option<Point<i32>>
fn as_double_pointed_mut(&mut self) -> Option<&mut dyn DoublePointed>
fn as_multi_pointed_mut(&mut self) -> Option<&mut dyn MultiPointed>
fn as_screen_fitting_mut(&mut self) -> Option<&mut dyn ScreenFitting>
impl Eq for SpriteDrawable
Source§impl PartialEq for SpriteDrawable
impl PartialEq for SpriteDrawable
Source§impl SinglePointed for SpriteDrawable
impl SinglePointed for SpriteDrawable
impl StructuralPartialEq for SpriteDrawable
Auto Trait Implementations§
impl Freeze for SpriteDrawable
impl RefUnwindSafe for SpriteDrawable
impl Send for SpriteDrawable
impl Sync for SpriteDrawable
impl Unpin for SpriteDrawable
impl UnsafeUnpin for SpriteDrawable
impl UnwindSafe for SpriteDrawable
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