[][src]Struct glerminal::TerminalBuilder

pub struct TerminalBuilder {
    pub title: String,
    pub dimensions: (u32, u32),
    pub clear_color: (f32, f32, f32, f32),
    pub font: Font,
    pub visibility: bool,
    pub headless: bool,
    pub text_buffer_aspect_ratio: bool,
    pub vsync: bool,
}

A builder for the Terminal. Includes some settings that can be set before building.

See terminal mod for examples and more detailed documentation.

Fields

title: String

Title of the Terminal window

dimensions: (u32, u32)

The dimensions the window will open at

clear_color: (f32, f32, f32, f32)

The clear color of the terminal.

font: Font

The font that the terminal uses

visibility: bool

Is the terminal visible/does it open when builded. It can be later opened/shown with show

headless: bool

Is the terminal headless, meaning there is no visual display for the terminal. Used for testing.

text_buffer_aspect_ratio: bool

Whether the aspect ratio should be retrieved from TextBuffer instead of the original resolution of the screen.

If set to false, the aspect ratio used to make black bars for the screen will be fetched from the original resolution of the screen; This will cause the fonts to strech a bit though.

If set to true (default), the aspect ratio will be fetched from the TextBuffer, causing almost any resolution to have black bars to make up for the missing spaces.

vsync: bool

Enable/Disable Vsync

Methods

impl TerminalBuilder
[src]

pub fn new() -> TerminalBuilder
[src]

Creates a new terminal builder with default settings.

pub fn with_title<T: Into<String>>(self, title: T) -> TerminalBuilder
[src]

Sets the title for the Terminal.

pub fn with_dimensions(self, dimensions: (u32, u32)) -> TerminalBuilder
[src]

Sets the dimensions the Terminal is to be opened with.

pub fn with_clear_color(
    self,
    clear_color: (f32, f32, f32, f32)
) -> TerminalBuilder
[src]

Sets the clear color of the terminal.

pub fn with_font(self, font: Font) -> TerminalBuilder
[src]

Changes the font that the terminal uses.

pub fn with_visibility(self, visibility: bool) -> TerminalBuilder
[src]

Changes the visibility that the terminal will be opened with. If headless, visibility will not matter.

pub fn with_headless(self, headless: bool) -> TerminalBuilder
[src]

Changes the visibility that the terminal will be opened with

pub fn with_text_buffer_aspect_ratio(self, tbar: bool) -> TerminalBuilder
[src]

Changes whether the aspect ratio should be retrieved from TextBuffer instead of the original resolution of the screen.

If set to false, the aspect ratio used to make black bars for the screen will be fetched from the original resolution of the screen; This will cause the fonts to strech a bit though.

If set to true (default), the aspect ratio will be fetched from the TextBuffer, causing almost any resolution to have black bars to make up for the missing spaces.

pub fn with_vsync(self, vsync: bool) -> TerminalBuilder
[src]

Enable/Disable vsync. Enabled by default.

pub fn build(self) -> Terminal
[src]

Builds the actual terminal and opens the window

Trait Implementations

impl Default for TerminalBuilder
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> Downcast for T where
    T: Any