[]Struct rltk::BTerm

pub struct BTerm {
    pub backend: BTermPlatform,
    pub width_pixels: u32,
    pub height_pixels: u32,
    pub fonts: Vec<Font>,
    pub shaders: Vec<Shader>,
    pub consoles: Vec<DisplayConsole>,
    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,
}

A BTerm context.

Fields

backend: BTermPlatformwidth_pixels: u32height_pixels: u32fonts: Vec<Font>shaders: Vec<Shader>consoles: Vec<DisplayConsole>fps: f32frame_time_ms: f32active_console: usizekey: Option<VirtualKeyCode>mouse_pos: (i32, i32)left_click: boolshift: boolcontrol: boolalt: boolweb_button: Option<String>quitting: boolpost_scanlines: boolpost_screenburn: bool

Methods

impl BTerm

pub fn init_raw<S, T>(
    width_pixels: T,
    height_pixels: T,
    window_title: S,
    platform_hints: InitHints
) -> BTerm where
    S: ToString,
    T: TryInto<u32>, 

Initializes an OpenGL context and a window, stores the info in the BTerm structure.

pub fn init_simple8x8<S, T>(
    width_chars: T,
    height_chars: T,
    window_title: S,
    path_to_shaders: S
) -> BTerm where
    S: ToString,
    T: TryInto<u32>, 

Deprecated since 0.6.2:

Please migrate to the BTermBuilder system instead.

Quick initialization for when you just want an 8x8 font terminal

pub fn init_simple8x16<S, T>(
    width_chars: T,
    height_chars: T,
    window_title: S,
    path_to_shaders: S
) -> BTerm where
    S: ToString,
    T: TryInto<u32>, 

Deprecated since 0.6.2:

Please migrate to the BTermBuilder system instead.

Quick initialization for when you just want an 8x16 VGA font terminal

pub fn register_font(&mut self, font: Font) -> usize

Registers a font, and returns its handle number. Also loads it into OpenGL.

pub fn register_console(
    &mut self,
    new_console: Box<dyn Console + 'static>,
    font_index: usize
) -> usize

Registers a new console terminal for output, and returns its handle number.

pub fn register_console_no_bg(
    &mut self,
    new_console: Box<dyn Console + 'static>,
    font_index: usize
) -> usize

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.

pub fn set_active_console(&mut self, id: usize)

Sets the currently active console number.

pub fn mouse_pos(&self) -> (i32, i32)

Applies the current physical mouse position to the active console, and translates the coordinates into that console's coordinate space.

pub fn mouse_point(&self) -> Point

Applies the current physical mouse position to the active console, and translates the coordinates into that console's coordinate space.

pub fn quit(&mut self)

Tells the game to quit

pub fn render_xp_sprite(&mut self, xp: &XpFile, x: i32, y: i32)

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.

pub fn to_xp_file(&self, width: usize, height: usize) -> XpFile

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.

pub fn with_post_scanlines(&mut self, with_burn: bool)

Enable scanlines post-processing effect.

Trait Implementations

impl Console for BTerm

Auto Trait Implementations

impl !RefUnwindSafe for BTerm

impl !Send for BTerm

impl !Sync for BTerm

impl Unpin for BTerm

impl !UnwindSafe for BTerm

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,