Skip to main content

TilemapEntry

Struct TilemapEntry 

Source
pub struct TilemapEntry {
    pub tile_id: u16,
    pub flip_h: bool,
    pub flip_v: bool,
    pub palette_group: u8,
    pub priority: u8,
    pub collision_override: Option<CollisionType>,
    pub animation_group: Option<u8>,
}
Expand description

A single entry in a tilemap, supporting 16-bit-style metadata.

Inspired by GBA’s screen entry format but not bound to GBA hardware. Each entry describes which tile to draw, how it should be transformed, and optional gameplay metadata (collision, animation frame group).

Fields§

§tile_id: u16

Tile index — supports >256 tiles (unlike the 1-byte GB limit).

§flip_h: bool

Flip the tile horizontally before rendering.

§flip_v: bool

Flip the tile vertically before rendering.

§palette_group: u8

Palette bank selection (which sub-palette to use).

§priority: u8

Layer priority (0 = lowest, rendered first / behind).

§collision_override: Option<CollisionType>

Per-tile collision override. When Some, this overrides the collision data that would normally come from tile-metadata tables.

§animation_group: Option<u8>

Animation frame group ID. When Some, the tile belongs to an animated sequence (e.g. water, flowers). The renderer uses this group index together with a global frame counter to select the correct tile.

Trait Implementations§

Source§

impl Clone for TilemapEntry

Source§

fn clone(&self) -> TilemapEntry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for TilemapEntry

Source§

impl Debug for TilemapEntry

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for TilemapEntry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for TilemapEntry

Source§

impl PartialEq for TilemapEntry

Source§

fn eq(&self, other: &TilemapEntry) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TilemapEntry

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.