Struct asefile::Tilemap

source ·
pub struct Tilemap<'a> { /* private fields */ }
Expand description

A reference to a tilemap.

A tilemap describes an image as a collection of tiles from a Tileset.

Every non-empty cel in a tilemap layer corresponds to one tilemap.

Implementations§

source§

impl<'a> Tilemap<'a>

source

pub fn width(&self) -> u32

Width in number of tiles

source

pub fn height(&self) -> u32

Height in number of tiles

source

pub fn tile_size(&self) -> (u32, u32)

Width and height of each tile in the tilemap.

source

pub fn tileset(&self) -> &Tileset

The tileset used by this tilemap.

source

pub fn image(&self) -> RgbaImage

The tilemap as one large image.

source

pub fn tile(&self, x: u32, y: u32) -> &Tile

Lookup tile at given location.

Tile coordinates start at (0, 0) in the top left.

Note: Aseprite as of 1.3-beta5 labels tile coordinates relative to the tile offsets. I.e., if your first column is empty, then the GUI shows -1 for the x coordinate of the top-left tile.

source

pub fn tile_offsets(&self) -> (i32, i32)

Describes first not-empty tile.

source

pub fn pixel_offsets(&self) -> (i32, i32)

Describes first non-empty tile in pixel offsets.

Auto Trait Implementations§

§

impl<'a> Freeze for Tilemap<'a>

§

impl<'a> RefUnwindSafe for Tilemap<'a>

§

impl<'a> Send for Tilemap<'a>

§

impl<'a> Sync for Tilemap<'a>

§

impl<'a> Unpin for Tilemap<'a>

§

impl<'a> UnwindSafe for Tilemap<'a>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.