Struct agb::display::object::ObjectUnmanaged
source · 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
impl ObjectUnmanaged
sourcepub fn new(sprite: SpriteVram) -> Self
pub fn new(sprite: SpriteVram) -> Self
Creates an unmanaged object from a sprite in vram.
sourcepub fn is_visible(&self) -> bool
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.
sourcepub fn show_affine(&mut self, affine_mode: AffineMode) -> &mut Self
pub fn show_affine(&mut self, affine_mode: AffineMode) -> &mut Self
Display the sprite in Affine mode.
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.
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.
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.
sourcepub fn hide(&mut self) -> &mut Self
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.
sourcepub fn set_position(&mut self, position: Vector2D<i32>) -> &mut Self
pub fn set_position(&mut self, position: Vector2D<i32>) -> &mut Self
Sets the position of the object.
sourcepub fn set_affine_matrix(
&mut self,
affine_matrix: AffineMatrixInstance
) -> &mut Self
pub fn set_affine_matrix( &mut self, affine_matrix: AffineMatrixInstance ) -> &mut Self
Sets the affine matrix. This only has an affect in Affine mode.
sourcepub fn set_sprite(&mut self, sprite: SpriteVram) -> &mut Self
pub fn set_sprite(&mut self, sprite: SpriteVram) -> &mut Self
Sets the current sprite for the object.
Trait Implementations§
source§impl Clone for ObjectUnmanaged
impl Clone for ObjectUnmanaged
source§fn clone(&self) -> ObjectUnmanaged
fn clone(&self) -> ObjectUnmanaged
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more