[][src]Struct tesserae::TileSet

pub struct TileSet { /* fields omitted */ }

A set of 512 8x8 pixel monochrome tiles, along with a map for the basic 256 ASCII characters to tile indices. Most tile sets only include character mappings for the typable characters on a conventional keyboard.

If indexed with usize, gives the 64 bit integer corresponding to the tile data for that tile index. Can also be mutated by assigning to a particular usize index.

Can also be indexed by char, which gives the tile index (a usize) corresponding to that particular character. The character map can be changed by assigning to a particular char index.

Methods

impl TileSet[src]

pub fn blank() -> TileSet[src]

Create a blank tile set with 512 tiles (all pixels off) and the default character map.

pub fn load_file<P: AsRef<Path>>(path: P) -> Result<TileSet>[src]

Load a tile set from the file with the given path. Sugar for load_from with File::open.

pub fn load_from<R: Read>(input: R) -> TileSet[src]

Load a tile set from a Read instance such as a file. Commonly used with include_bin! like so:

let ts = include_bytes!("tile_set");
TileSet::load_from(Cursor::new(&ts[..]))

pub fn default() -> TileSet[src]

A built-in tile set used in, among other things, the tesseraed editor.

pub fn cga_ascii() -> TileSet[src]

A built-in tile set containing the 256 CGA standard ASCII characters using the font used in Hercules graphics cards.

pub fn petscii() -> TileSet[src]

The regular, all-uppercase shifted PETscii tile set used in Commodore PET and Commodore 64 machines.

pub fn petscii_unshifted() -> TileSet[src]

The unshifted PETscii tile set which includes lower case letters used in Commodore PET and Commodore 64 machines.

pub fn store<P: AsRef<Path>>(&self, path: P) -> Result<()>[src]

Save the tileset to a file at the provided path.

pub fn len(&self) -> usize[src]

Should always return 512, but using this gives you future-proofing in case the tile set size changes in future.

Trait Implementations

impl Clone for TileSet[src]

impl Index<char> for TileSet[src]

type Output = usize

The returned type after indexing.

impl Index<usize> for TileSet[src]

type Output = u64

The returned type after indexing.

impl IndexMut<char> for TileSet[src]

impl IndexMut<usize> for TileSet[src]

Auto Trait Implementations

impl RefUnwindSafe for TileSet

impl Send for TileSet

impl Sync for TileSet

impl Unpin for TileSet

impl UnwindSafe for TileSet

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.