Struct bracket_terminal::prelude::SparseConsole [−][src]
pub struct SparseConsole {
pub width: u32,
pub height: u32,
pub tiles: Vec<SparseTile>,
pub is_dirty: bool,
pub offset_x: f32,
pub offset_y: f32,
pub scale: f32,
pub scale_center: (i32, i32),
pub extra_clipping: Option<Rect>,
pub translation: CharacterTranslationMode,
// some fields omitted
}Expand description
A sparse console. Rather than storing every cell on the screen, it stores just cells that have data.
Fields
width: u32height: u32tiles: Vec<SparseTile>is_dirty: booloffset_x: f32offset_y: f32scale: f32scale_center: (i32, i32)extra_clipping: Option<Rect>translation: CharacterTranslationModeImplementations
Trait Implementations
Clear the screen. Since we don’t HAVE a background, it doesn’t use it.
Prints a string to an x/y position, with foreground and background colors.
Sets a single cell in the console
Draws a box, starting at x/y with the extents width/height using CP437 line characters
Draws a box, starting at x/y with the extents width/height using CP437 double line characters
Draws a box, starting at x/y with the extents width/height using CP437 line characters
Draws a box, starting at x/y with the extents width/height using CP437 double line characters
Fills a rectangle with the specified rendering information
Draws a horizontal progress bar
Draws a vertical progress bar
Prints text, centered to the whole console width, at vertical location y.
Prints text in color, centered to the whole console width, at vertical location y.
Prints text, centered to the whole console width, at vertical location y.
Prints text in color, centered to the whole console width, at vertical location y.
Prints text right-aligned
Prints colored text right-aligned
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.
Saves the layer to an XpFile structure
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.
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
Sets the character size of the terminal
Specify a scale and center of the console. A scale above 1.0 will make the text larger. The center of the scale is at character position (center_x, center_y). Read more
Get the scale & center of the console. Returns (scale, center_x, center_y). Read more
Produces the implementor as an Any that can be matched to determine type and access natively. Read more
Produces the implementor as an Any that can be matched to determine type and access natively. Read more
Returns true if an x/y coordinate is within the console bounds
Auto Trait Implementations
impl RefUnwindSafe for SparseConsoleimpl Send for SparseConsoleimpl Sync for SparseConsoleimpl Unpin for SparseConsoleimpl UnwindSafe for SparseConsole