Struct bracket_terminal::prelude::BTerm [−][src]
pub struct BTerm {Show fields
pub width_pixels: u32,
pub height_pixels: u32,
pub original_height_pixels: u32,
pub original_width_pixels: u32,
pub fps: f32,
pub frame_time_ms: f32,
pub active_console: usize,
pub key: Option<VirtualKeyCode>,
pub mouse_pos: (i32, i32),
pub left_click: bool,
pub shift: bool,
pub control: bool,
pub alt: bool,
pub web_button: Option<String>,
pub quitting: bool,
pub post_scanlines: bool,
pub post_screenburn: bool,
pub screen_burn_color: RGB,
}Expand description
A BTerm context.
Fields
width_pixels: u32height_pixels: u32original_height_pixels: u32original_width_pixels: u32fps: f32frame_time_ms: f32active_console: usizekey: Option<VirtualKeyCode>mouse_pos: (i32, i32)left_click: boolshift: boolcontrol: boolalt: boolquitting: boolpost_scanlines: boolpost_screenburn: boolscreen_burn_color: RGBImplementations
Initializes an OpenGL context and a window, stores the info in the BTerm structure.
pub fn init_simple8x8<S: ToString, T>(
width_chars: T,
height_chars: T,
window_title: S,
path_to_shaders: S
) -> BTerm where
T: TryInto<u32>, 👎 Deprecated since 0.6.2: Please migrate to the BTermBuilder system instead.
pub fn init_simple8x8<S: ToString, T>(
width_chars: T,
height_chars: T,
window_title: S,
path_to_shaders: S
) -> BTerm where
T: TryInto<u32>, Please migrate to the BTermBuilder system instead.
Quick initialization for when you just want an 8x8 font terminal
pub fn init_simple8x16<S: ToString, T>(
width_chars: T,
height_chars: T,
window_title: S,
path_to_shaders: S
) -> BTerm where
T: TryInto<u32>, 👎 Deprecated since 0.6.2: Please migrate to the BTermBuilder system instead.
pub fn init_simple8x16<S: ToString, T>(
width_chars: T,
height_chars: T,
window_title: S,
path_to_shaders: S
) -> BTerm where
T: TryInto<u32>, Please migrate to the BTermBuilder system instead.
Quick initialization for when you just want an 8x16 VGA font terminal
Registers a new console terminal for output, and returns its handle number.
Registers a new console terminal for output, and returns its handle number. This variant requests that the new console not render background colors, so it can be layered on top of other consoles.
Registers a new console terminal for output, and returns its handle number. This variant requests that the new console not render background colors, so it can be layered on top of other consoles.
Registers a new Sprite-based console
Sets the currently active console number.
Applies the current physical mouse position to the active console, and translates the coordinates into that console’s coordinate space.
Applies the current physical mouse position to the active console, and translates the coordinates into that console’s coordinate space.
Render a REX Paint (https://www.gridsagegames.com/rexpaint/) file as a sprite. The sprite will be offset by offset_x and offset_y. Transparent cells will not be rendered.
Saves the entire console stack to a REX Paint XP file. If your consoles are of
varying sizes, the file format supports it - but REX doesn’t. So you may want to
avoid that. You can also get individual layers with to_xp_layer.
Enable scanlines post-processing effect.
Implements console-like BTerm. Note that this isn’t a Console trait anymore, due to the need for helper generics.
Request that the active console clear itself to a specified background color. Has no effect on consoles that don’t have a background color.
Print a string to the active console.
Print a string to the active console, in color.
Set a single tile located at x/y to the specified foreground/background colors, and glyph.
Set a tile with “fancy” additional attributes
Sets the background color only of a specified tile.
Draws a filled box, with single line characters.
Draws a filled box, with double line characters.
Draws a single-line box, without filling in the center.
Draws a double-line box, without filling in the contents.
Draws a horizontal bar, suitable for health-bars or progress bars.
Draws a vertical bar, suitable for health-bars or progress bars.
pub fn fill_region<COLOR, COLOR2, GLYPH>(
&mut self,
target: Rect,
glyph: GLYPH,
fg: COLOR,
bg: COLOR2
) where
COLOR: Into<RGBA>,
COLOR2: Into<RGBA>,
GLYPH: TryInto<FontCharType>,
pub fn fill_region<COLOR, COLOR2, GLYPH>(
&mut self,
target: Rect,
glyph: GLYPH,
fg: COLOR,
bg: COLOR2
) where
COLOR: Into<RGBA>,
COLOR2: Into<RGBA>,
GLYPH: TryInto<FontCharType>, Fills a target region with the specified color/glyph combo.
Prints centered text, centered across the whole line
Prints centered text, centered across the whole line - in color
Prints text, centered on an arbitrary point
Prints colored text, centered on an arbitrary point
Prints right-aligned text
Prints right-aligned text, in color
Print a colorized string with the color encoding defined inline. For example: printer(1, 1, “#[blue]This blue text contains a #[pink]pink#[] word”) You can get the same effect with a TextBlock, but this can be easier. Thanks to doryen_rs for the idea.
Exports the current layer to a REX Paint file
Sets the active offset for the current layer
Sets the active scale for the current layer
Permits the creation of an arbitrary clipping rectangle. It’s a really good idea to make sure that this rectangle is entirely valid.
Returns the current arbitrary clipping rectangle, None if there isn’t one.
Sets ALL tiles foreground alpha (only tiles that exist, in sparse consoles).
Sets ALL tiles background alpha (only tiles that exist, in sparse consoles).
Sets ALL tiles foreground alpha (only tiles that exist, in sparse consoles).
Sets the character translation mode on a console
Change the active font for the layer. DO NOT USE WITH AMETHYST YET.
Manually override the character size for the current terminal. Use with caution!
Manually override the character size for the current terminal. Use with caution!
Take a screenshot - Native only
Register a sprite sheet (OpenGL - native or WASM - only)
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BTermimpl UnwindSafe for BTermBlanket Implementations
Mutably borrows from an owned value. Read more