[−][src]Struct bracket_lib::prelude::SimpleConsole
A simple console with background color.
Fields
width: u32
height: u32
tiles: Vec<Tile>
is_dirty: bool
Methods
impl SimpleConsole
[src]
pub fn init(
width: u32,
height: u32,
platform: &BTermPlatform
) -> Box<SimpleConsole>
[src]
width: u32,
height: u32,
platform: &BTermPlatform
) -> Box<SimpleConsole>
Initializes a console, ready to add to BTerm's console list.
Trait Implementations
impl Console for SimpleConsole
[src]
fn rebuild_if_dirty(&mut self, platform: &BTermPlatform)
[src]
Check if the console has changed, and if it has rebuild the backing buffer.
fn get_char_size(&self) -> (u32, u32)
[src]
fn resize_pixels(&mut self, _width: u32, _height: u32)
[src]
fn gl_draw(&mut self, font: &Font, shader: &Shader, platform: &BTermPlatform)
[src]
Sends the console to OpenGL.
fn at(&self, x: i32, y: i32) -> usize
[src]
Translate an x/y into an array index.
fn cls(&mut self)
[src]
Clears the screen.
fn cls_bg(&mut self, background: RGB)
[src]
Clears the screen with a background color.
fn print(&mut self, x: i32, y: i32, output: &str)
[src]
Prints a string at x/y.
fn print_color(&mut self, x: i32, y: i32, fg: RGB, bg: RGB, output: &str)
[src]
Prints a string at x/y, with foreground and background colors.
fn set(&mut self, x: i32, y: i32, fg: RGB, bg: RGB, glyph: u8)
[src]
Sets a single cell in the console
fn set_bg(&mut self, x: i32, y: i32, bg: RGB)
[src]
Sets a single cell in the console's background
fn draw_box(
&mut self,
sx: i32,
sy: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
sx: i32,
sy: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
Draws a box, starting at x/y with the extents width/height using CP437 line characters
fn draw_hollow_box(
&mut self,
sx: i32,
sy: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
sx: i32,
sy: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
Draws a box, starting at x/y with the extents width/height using CP437 line characters
fn draw_box_double(
&mut self,
sx: i32,
sy: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
sx: i32,
sy: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
Draws a box, starting at x/y with the extents width/height using CP437 double line characters
fn draw_hollow_box_double(
&mut self,
sx: i32,
sy: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
sx: i32,
sy: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
Draws a box, starting at x/y with the extents width/height using CP437 double line characters
fn fill_region(&mut self, target: Rect, glyph: u8, fg: RGB, bg: RGB)
[src]
Fills a rectangle with the specified rendering information
fn get(&self, x: i32, y: i32) -> Option<(&u8, &RGB, &RGB)>
[src]
Gets the content of a cell
fn draw_bar_horizontal(
&mut self,
sx: i32,
sy: i32,
width: i32,
n: i32,
max: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
sx: i32,
sy: i32,
width: i32,
n: i32,
max: i32,
fg: RGB,
bg: RGB
)
Draws a horizontal progress bar
fn draw_bar_vertical(
&mut self,
sx: i32,
sy: i32,
height: i32,
n: i32,
max: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
sx: i32,
sy: i32,
height: i32,
n: i32,
max: i32,
fg: RGB,
bg: RGB
)
Draws a vertical progress bar
fn print_centered(&mut self, y: i32, text: &str)
[src]
Prints text, centered to the whole console width, at vertical location y.
fn print_color_centered(&mut self, y: i32, fg: RGB, bg: RGB, text: &str)
[src]
Prints text in color, centered to the whole console width, at vertical location y.
fn to_xp_layer(&self) -> XpLayer
[src]
Saves the layer to an XpFile structure
fn set_offset(&mut self, x: f32, y: f32)
[src]
Sets an offset to total console rendering, useful for layers that draw between tiles. Offsets are specified as a percentage of total character size; so -0.5 will offset half a character to the left/top.
fn set_scale(&mut self, scale: f32, center_x: i32, center_y: i32)
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn in_bounds(&self, x: i32, y: i32) -> bool
[src]
fn try_at(&self, x: i32, y: i32) -> Option<usize>
[src]
Auto Trait Implementations
impl RefUnwindSafe for SimpleConsole
impl Send for SimpleConsole
impl Sync for SimpleConsole
impl Unpin for SimpleConsole
impl UnwindSafe for SimpleConsole
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, 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,