Struct glerminal::text_buffer::TextBuffer
[−]
[src]
pub struct TextBuffer { /* fields omitted */ }
Represents the text buffer of the terminal; contains the "grid of TermCharacters
" that will be drawn.
See text_buffer mod for examples and more detailed documentation.
Methods
impl TextBuffer
[src]
pub fn new(
terminal: &Terminal,
dimensions: (i32, i32)
) -> Result<TextBuffer, String>
[src]
terminal: &Terminal,
dimensions: (i32, i32)
) -> Result<TextBuffer, String>
Creates a new text buffer with the given dimensions (width in characters, height in characters)
pub fn get_character(&self, x: i32, y: i32) -> TermCharacter
[src]
Gets the TermChaacter in the given position
pub fn clear(&mut self)
[src]
Clears the screen (makes every character empty and resets their style)
pub fn put_char(&mut self, character: char)
[src]
Puts a character to the current position of the cursor with the cursor's style
pub fn write<T: Into<String>>(&mut self, text: T)
[src]
Puts the given text the same way as put_char
pub fn change_cursor_fg_color(&mut self, color: Color)
[src]
Changes the foreground color for the cursor
pub fn change_cursor_bg_color(&mut self, color: Color)
[src]
Changes the background color of the cursor
pub fn get_cursor_fg_color(&mut self) -> Color
[src]
Returns the current foreground color of the cursor
pub fn get_cursor_bg_color(&mut self) -> Color
[src]
Returns the current background color of the cursor
pub fn change_cursor_shakiness(&mut self, shakiness: f32)
[src]
Changes the shakiness of the cursor
pub fn get_cursor_shakiness(&mut self) -> f32
[src]
Gets the current shakiness of the cursor
pub fn move_cursor(&mut self, x: i32, y: i32)
[src]
Moves the cursor to a specified location in the terminal. If the location does not exist, nothing happens.
pub fn get_cursor_position(&self) -> (i32, i32)
[src]
Returns the current position of the cursor