[−][src]Struct thorium::dmg_render::DMGOAMEntry
An individual entry within the DMG OAM.
Fields
xm8: u8
X-8 of the object (viewport relative).
Objects are 8 pixels wide, so if you use 0 here then the object will be all the way off the left of the screen.
ym16: u8
Y-16 of the object (viewport relative).
Objects are 8 or 16 pixels tall, so if this value is low enough the object will be all the way above the screen.
tile_id: u8
The tile index for this object.
Objects always index from the base of block 0 of the VRAM. If objects are
set for "tall" mode, then the least bit is ignored and the upper part of
the object will be the even index of the tile pair (tile_id & 0xFE
) and
the lower part of the object will be the odd index (tile_id | 0x01
).
display_behind_bg_win_13: bool
Causes this object to be "behind" non-zero-index background/win pixels.
If this flag is enabled wherever the pixel from the background or window comes from indexes 1, 2, or 3 then the object won't get to use its pixel. If this flag is disabled then the object overrides the base index all the time.
vflip: bool
Flip the object vertically.
hflip: bool
Flip the object horizontally.
use_high_palette: bool
If the object should use the high bank for palette translation.
Methods
impl DMGOAMEntry
[src]
pub fn screen_left_top(&self) -> (u8, u8)
[src]
Obtains the left and top position of the object in screen space.
pub fn get_pixel(
&self,
screen_x: u8,
screen_y: u8,
memory: &DMGTileMemory,
tall: bool
) -> u8
[src]
&self,
screen_x: u8,
screen_y: u8,
memory: &DMGTileMemory,
tall: bool
) -> u8
Obtains the pixel from this object on the screen.
Panics
If the screen_x or screen_y are out of bounds this will panic
Trait Implementations
impl Clone for DMGOAMEntry
[src]
fn clone(&self) -> DMGOAMEntry
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for DMGOAMEntry
[src]
fn default() -> DMGOAMEntry
[src]
impl Debug for DMGOAMEntry
[src]
Auto Trait Implementations
impl Send for DMGOAMEntry
impl Sync for DMGOAMEntry
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
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>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,