[−][src]Struct tesserae::TileSet
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]
impl Index<usize> for TileSet
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,