pub struct Object { /* private fields */ }
Expand description
An object that can be shown on the screen
Implementations§
Source§impl Object
impl Object
Sourcepub fn show(&self, frame: &mut GraphicsFrame<'_>)
pub fn show(&self, frame: &mut GraphicsFrame<'_>)
Show the object on the current frame
Sourcepub fn new(sprite: impl Into<SpriteVram>) -> Self
pub fn new(sprite: impl Into<SpriteVram>) -> Self
Creates an unmanaged object from a sprite in vram.
Sourcepub fn set_hflip(&mut self, flip: bool) -> &mut Self
pub fn set_hflip(&mut self, flip: bool) -> &mut Self
Sets the horizontal flip, note that this only has a visible affect in Normal mode.
Use hflip to get the value
Sourcepub fn set_vflip(&mut self, flip: bool) -> &mut Self
pub fn set_vflip(&mut self, flip: bool) -> &mut Self
Sets the vertical flip, note that this only has a visible affect in Normal mode.
Use vflip to get the value
Sourcepub fn set_priority(&mut self, priority: Priority) -> &mut Self
pub fn set_priority(&mut self, priority: Priority) -> &mut Self
Sets the priority of the object relative to the backgrounds priority.
Use priority to get the value
Sourcepub fn priority(&self) -> Priority
pub fn priority(&self) -> Priority
Returns the priority of the object
Use set_priority to set the value
Sourcepub fn set_pos(&mut self, position: impl Into<Vector2D<i32>>) -> &mut Self
pub fn set_pos(&mut self, position: impl Into<Vector2D<i32>>) -> &mut Self
Sets the position of the object.
Use pos to get the value
Sourcepub fn pos(&self) -> Vector2D<i32>
pub fn pos(&self) -> Vector2D<i32>
Returns the position of the object
Use set_pos to set the value
Sourcepub fn set_sprite(&mut self, sprite: impl Into<SpriteVram>) -> &mut Self
pub fn set_sprite(&mut self, sprite: impl Into<SpriteVram>) -> &mut Self
Sets the current sprite for the object.
Sourcepub fn set_graphics_mode(&mut self, mode: GraphicsMode) -> &mut Self
pub fn set_graphics_mode(&mut self, mode: GraphicsMode) -> &mut Self
Sets the graphics mode of the object
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Object
impl !RefUnwindSafe for Object
impl !Send for Object
impl !Sync for Object
impl Unpin for Object
impl !UnwindSafe for Object
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)