[][src]Struct rltk::Rltk

pub struct Rltk {
    pub backend: RltkPlatform,
    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,
}

An RLTK context.

Fields

backend: RltkPlatformwidth_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 Rltk[src]

pub fn init_raw<S: ToString>(
    width_pixels: u32,
    height_pixels: u32,
    window_title: S
) -> Rltk
[src]

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

pub fn init_simple8x8<S: ToString>(
    width_chars: u32,
    height_chars: u32,
    window_title: S,
    path_to_shaders: S
) -> Rltk
[src]

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

pub fn init_simple8x16<S: ToString>(
    width_chars: u32,
    height_chars: u32,
    window_title: S,
    path_to_shaders: S
) -> Rltk
[src]

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

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

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

pub fn register_console(
    &mut self,
    new_console: Box<dyn Console>,
    font_index: usize
) -> usize
[src]

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>,
    font_index: usize
) -> usize
[src]

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)[src]

Sets the currently active console number.

pub fn mouse_pos(&mut self) -> (i32, i32)[src]

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)[src]

Tells the game to quit

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

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[src]

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)[src]

Enable scanlines post-processing effect.

Trait Implementations

impl Console for Rltk[src]

Auto Trait Implementations

impl !RefUnwindSafe for Rltk

impl !Send for Rltk

impl !Sync for Rltk

impl Unpin for Rltk

impl !UnwindSafe for Rltk

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>,