pub struct ObjectUnmanaged { /* private fields */ }
Expand description

An object to be used by the OamUnmanaged system. Changes made here are reflected when set to an OamSlot using OamSlot::set.

Implementations§

source§

impl ObjectUnmanaged

source

pub fn new(sprite: SpriteVram) -> Self

Creates an unmanaged object from a sprite in vram.

source

pub fn is_visible(&self) -> bool

Checks whether the object is not marked as hidden. Note that it could be off screen or completely transparent and still claimed to be visible.

source

pub fn show(&mut self) -> &mut Self

Display the sprite in Normal mode.

source

pub fn show_affine(&mut self, affine_mode: AffineMode) -> &mut Self

Display the sprite in Affine mode.

source

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.

source

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.

source

pub fn set_priority(&mut self, priority: Priority) -> &mut Self

Sets the priority of the object relative to the backgrounds priority.

source

pub fn hide(&mut self) -> &mut Self

Changes the sprite mode to be hidden, can be changed to Normal or Affine modes using show and show_affine respectively.

source

pub fn set_x(&mut self, x: u16) -> &mut Self

Sets the x position of the object.

source

pub fn set_y(&mut self, y: u16) -> &mut Self

Sets the y position of the object.

source

pub fn set_position(&mut self, position: Vector2D<i32>) -> &mut Self

Sets the position of the object.

source

pub fn set_affine_matrix( &mut self, affine_matrix: AffineMatrixInstance ) -> &mut Self

Sets the affine matrix. This only has an affect in Affine mode.

source

pub fn set_sprite(&mut self, sprite: SpriteVram) -> &mut Self

Sets the current sprite for the object.

Trait Implementations§

source§

impl Clone for ObjectUnmanaged

source§

fn clone(&self) -> ObjectUnmanaged

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ObjectUnmanaged

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for ObjectUnmanaged

§

impl !Send for ObjectUnmanaged

§

impl !Sync for ObjectUnmanaged

§

impl Unpin for ObjectUnmanaged

§

impl !UnwindSafe for ObjectUnmanaged

Blanket Implementations§

§

impl<T> Any for Twhere T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for Twhere U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.