pub struct OamSprite {
pub index: u8,
pub x: u8,
pub y: u8,
pub tile: u8,
pub palette: u8,
pub behind_background: bool,
pub flip_h: bool,
pub flip_v: bool,
pub visible: bool,
pub raw: [u8; 4],
}Expand description
A single sprite entry from OAM (4 bytes interpreted).
NES OAM format per sprite:
- Byte 0: Y position (actual Y = value + 1, values 0xEF-0xFF hide sprite)
- Byte 1: Tile index
- Byte 2: Attributes (palette, priority, flip)
- Byte 3: X position
Fields§
§index: u8Sprite index (0-63)
x: u8X position (0-255, values 0xF9-0xFF partially offscreen right)
y: u8Y position (raw value; actual screen Y = y + 1)
tile: u8Tile index number
palette: u8Palette index (0-3, actual palette 4-7)
behind_background: boolPriority: false = in front of background, true = behind background
flip_h: boolFlip sprite horizontally
flip_v: boolFlip sprite vertically
visible: boolWhether sprite is visible (Y < 0xEF)
raw: [u8; 4]Raw 4 bytes for this sprite
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OamSprite
impl RefUnwindSafe for OamSprite
impl Send for OamSprite
impl Sync for OamSprite
impl Unpin for OamSprite
impl UnsafeUnpin for OamSprite
impl UnwindSafe for OamSprite
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more