Struct dwarf_term::DwarfTerm [−][src]
pub struct DwarfTerm { /* fields omitted */ }
A terminal where each cell has a foreground, background, and sprite id.
Methods
impl DwarfTerm
[src]
impl DwarfTerm
pub fn new<T>(
grid_width: u32,
grid_height: u32,
title: T
) -> Result<Self, DwarfTermGliumError> where
T: Into<String>,
[src]
pub fn new<T>(
grid_width: u32,
grid_height: u32,
title: T
) -> Result<Self, DwarfTermGliumError> where
T: Into<String>,
Makes a new terminal of the given size and with the given title.
pub fn set_all_foregrounds(&mut self, rgba: u32)
[src]
pub fn set_all_foregrounds(&mut self, rgba: u32)
Sets the foreground color of every cell to be the given value.
pub fn set_all_backgrounds(&mut self, rgba: u32)
[src]
pub fn set_all_backgrounds(&mut self, rgba: u32)
Sets the foreground color of every cell to be the given value.
pub fn set_all_ids(&mut self, tile_id: u8)
[src]
pub fn set_all_ids(&mut self, tile_id: u8)
Sets the tile id of every cell to be the given value.
pub fn set_clear_color(&mut self, r: f32, g: f32, b: f32, a: f32)
[src]
pub fn set_clear_color(&mut self, r: f32, g: f32, b: f32, a: f32)
Sets the "clear" color that's used.
This just passes the call along to OpenGL. Inputs should each be in the 0.0 to 1.0 (inclusive) range. Out of bounds inputs are automatically clamped by OpenGL.
pub fn get_foreground_mut(
&mut self,
position: (usize, usize)
) -> Option<&mut u32>
[src]
pub fn get_foreground_mut(
&mut self,
position: (usize, usize)
) -> Option<&mut u32>
gets a mutable reference to the foreground at the position specified.
Fails if the position would be out of bounds.
pub fn get_background_mut(
&mut self,
position: (usize, usize)
) -> Option<&mut u32>
[src]
pub fn get_background_mut(
&mut self,
position: (usize, usize)
) -> Option<&mut u32>
gets a mutable reference to the background at the position specified.
Fails if the position would be out of bounds.
pub fn get_id_mut(&mut self, position: (usize, usize)) -> Option<&mut u8>
[src]
pub fn get_id_mut(&mut self, position: (usize, usize)) -> Option<&mut u8>
gets a mutable reference to the tile id at the position specified.
Fails if the position would be out of bounds.
pub fn poll_events<F>(&mut self, callback: F) where
F: FnMut(Event),
[src]
pub fn poll_events<F>(&mut self, callback: F) where
F: FnMut(Event),
Lets you poll for events on the window.
The DwarfTerm will automatically check for WindowEvent::Resized
events
and then keep itself up to date. However, it will also pass along such
events to your callback so that you can make any necessary changes on your
end as well.
pub fn layer_slices(&self) -> (ImageSlice<u32>, ImageSlice<u32>, ImageSlice<u8>)
[src]
pub fn layer_slices(&self) -> (ImageSlice<u32>, ImageSlice<u32>, ImageSlice<u8>)
Gives back all three layers at once in image slice form.
(fgs, bgs, ids).
pub fn layer_slices_mut(
&mut self
) -> (ImageMutSlice<u32>, ImageMutSlice<u32>, ImageMutSlice<u8>)
[src]
pub fn layer_slices_mut(
&mut self
) -> (ImageMutSlice<u32>, ImageMutSlice<u32>, ImageMutSlice<u8>)
Gives back all three layers at once in image mutable slice form.
(fgs, bgs, ids).
pub fn clear_draw_swap(&mut self) -> Result<(), DwarfTermGliumError>
[src]
pub fn clear_draw_swap(&mut self) -> Result<(), DwarfTermGliumError>
Clears the old screen, draws the new data, and then swaps the buffers.
This should hopefully never error! But it might. If it does, there's a strong chance it's my fault, not yours.