[][src]Struct glerminal::menu_systems::Window

pub struct Window {
    pub width: u32,
    pub height: u32,
    pub title: String,
    pub border_color: [f32; 4],
    pub border_title_color: [f32; 4],
    pub background_color: [f32; 4],
    // some fields omitted
}

Represents a window that clears everything in it's way and is able to limit the cursor within it's bounds with set_limits.

Windows API and usage is still subject to change in future updates.

For example a 2x2 window creates a 2x2 area and surrounds it with borders.

use glerminal::menu_systems::Window;

Window::new(2, 2);

// Creates a window that looks like (box-drawing characters used in places of borders)
// ████
// █  █
// █  █
// ████

Fields

width: u32

The width of the window

height: u32

The height of the window

title: String

Sets the title of the window

border_color: [f32; 4]

The border color for the window

border_title_color: [f32; 4]

The border title color for the window

background_color: [f32; 4]

The background (inside the frame) color of the window.

Methods

impl Window
[src]

pub fn new(width: u32, height: u32) -> Window
[src]

Creates a new window with the given width and height

pub fn with_pos(self, position: (u32, u32)) -> Window
[src]

Sets the initial position of the window.

pub fn with_width(self, width: u32) -> Window
[src]

Sets the initial width of the window

pub fn with_height(self, height: u32) -> Window
[src]

Sets the initial height of the window

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

Sets the initial title of the window

pub fn with_border_color(self, color: [f32; 4]) -> Window
[src]

Sets the initial border color for the window

pub fn with_border_title_color(self, color: [f32; 4]) -> Window
[src]

Sets the initial border title color for the window

pub fn with_background_color(self, color: [f32; 4]) -> Window
[src]

Set the background (inside the frame) color of the window.

pub fn set_pos(&mut self, position: (u32, u32))
[src]

Sets the position of the window.

pub fn draw(&self, text_buffer: &mut TextBuffer)
[src]

Draws the window

pub fn set_limits(&self, text_buffer: &mut TextBuffer)
[src]

Set limits for the TextBuffer so that nothing can be written outside the window.

Auto Trait Implementations

impl Send for Window

impl Sync for Window

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]