Struct tato::Renderer

source ·
pub struct Renderer<T, P>
where T: TilesetEnum, P: PaletteEnum,
{ /* private fields */ }
Expand description

Loads and stores fixed size tiles organized into tilesets that can be added and removed individually.

Implementations§

source§

impl<T, P> Renderer<T, P>
where T: TilesetEnum, P: PaletteEnum,

source

pub fn width(&self) -> u16

source

pub fn height(&self) -> u16

source

pub fn tile_width(&self) -> u8

source

pub fn tile_height(&self) -> u8

source

pub fn load_palettes_from_atlas(&mut self, atlas: &Atlas<T, P>)

source

pub fn pop_tileset(&mut self)

source

pub fn load_tileset( &mut self, atlas: &Atlas<T, P>, tileset_id: impl TilesetEnum )

source

pub fn get_tileset_palette(&self, tileset_id: impl Into<usize>) -> &Palette

source

pub fn get_tilemap( &self, tileset_id: impl Into<usize>, tilemap_id: impl Into<usize> ) -> &Tilemap

source

pub fn get_tilemap_mut( &mut self, tileset_id: impl Into<usize>, tilemap_id: impl Into<usize> ) -> &mut Tilemap

source

pub fn get_font( &self, tileset_id: impl Into<usize>, font_id: impl Into<usize> ) -> &Font

source

pub fn get_anim( &self, tileset_id: impl Into<usize>, anim_id: impl Into<usize> ) -> &Anim

source

pub fn get_tile(&self, index: u8, tileset_id: usize) -> TileID

source

pub fn get_rect(&self, index: usize) -> Rect<u8>

source

pub fn get_pixel(&self, x: usize, y: usize) -> u8

Auto Trait Implementations§

§

impl<T, P> Freeze for Renderer<T, P>

§

impl<T, P> RefUnwindSafe for Renderer<T, P>

§

impl<T, P> Send for Renderer<T, P>
where P: Send, T: Send,

§

impl<T, P> Sync for Renderer<T, P>
where P: Sync, T: Sync,

§

impl<T, P> Unpin for Renderer<T, P>
where P: Unpin, T: Unpin,

§

impl<T, P> UnwindSafe for Renderer<T, P>
where P: UnwindSafe, T: UnwindSafe,

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.