Struct mosaic::TileSet [−][src]
A set of tiles made from a tilesheet image.
Methods
impl<Key: Hash + Eq> TileSet<Key>
[src]
impl<Key: Hash + Eq> TileSet<Key>
pub fn new<S: Into<Vector2<i32>>>(sheet: Image, tile_size: S) -> Self
[src]
pub fn new<S: Into<Vector2<i32>>>(sheet: Image, tile_size: S) -> Self
Create a new TileSet
from an image and tile size.
pub fn register_tile<I: Into<Point2<i32>>>(
&mut self,
key: Key,
index: I
) -> Result<(), TileSetError>
[src]
pub fn register_tile<I: Into<Point2<i32>>>(
&mut self,
key: Key,
index: I
) -> Result<(), TileSetError>
Register a tile from the tilesheet to the TileSet
with the lookup
value of key
.
pub fn queue_tile<P: Into<Point2<i32>>, TP: Into<TileParams>>(
&mut self,
key: Key,
draw_location: P,
options: Option<TP>
) -> Result<(), TileSetError>
[src]
pub fn queue_tile<P: Into<Point2<i32>>, TP: Into<TileParams>>(
&mut self,
key: Key,
draw_location: P,
options: Option<TP>
) -> Result<(), TileSetError>
Queue a tile with the lookup value key
to be drawn at draw_location
,
with optional drawing options.
pub fn clear_queue(&mut self)
[src]
pub fn clear_queue(&mut self)
Clear the tile queue.
pub fn draw(&self, ctx: &mut Context) -> GameResult<()>
[src]
pub fn draw(&self, ctx: &mut Context) -> GameResult<()>
Draw the tiles using ctx
.