[−][src]Struct rltk::Rltk
An RLTK context.
Fields
backend: RltkPlatform
width_pixels: u32
height_pixels: u32
fonts: Vec<Font>
shaders: Vec<Shader>
consoles: Vec<DisplayConsole>
fps: f32
frame_time_ms: f32
active_console: usize
key: Option<VirtualKeyCode>
mouse_pos: (i32, i32)
left_click: bool
shift: bool
control: bool
alt: bool
quitting: bool
post_scanlines: bool
post_screenburn: bool
Methods
impl Rltk
[src]
pub fn init_raw<S: ToString>(
width_pixels: u32,
height_pixels: u32,
window_title: S
) -> Rltk
[src]
width_pixels: u32,
height_pixels: u32,
window_title: S
) -> Rltk
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]
width_chars: u32,
height_chars: u32,
window_title: S,
path_to_shaders: S
) -> Rltk
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]
width_chars: u32,
height_chars: u32,
window_title: S,
path_to_shaders: S
) -> Rltk
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]
&mut self,
new_console: Box<dyn Console>,
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>,
font_index: usize
) -> usize
[src]
&mut self,
new_console: Box<dyn Console>,
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)
[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]
fn rebuild_if_dirty(&mut self, _platform: &RltkPlatform)
[src]
fn gl_draw(&mut self, _font: &Font, _shader: &Shader, _platform: &RltkPlatform)
[src]
fn get_char_size(&mut self) -> (u32, u32)
[src]
fn resize_pixels(&mut self, width: u32, height: u32)
[src]
fn at(&self, x: i32, y: i32) -> usize
[src]
fn cls(&mut self)
[src]
fn cls_bg(&mut self, background: RGB)
[src]
fn print(&mut self, x: i32, y: i32, output: &str)
[src]
fn print_color(&mut self, x: i32, y: i32, fg: RGB, bg: RGB, output: &str)
[src]
fn set(&mut self, x: i32, y: i32, fg: RGB, bg: RGB, glyph: u8)
[src]
fn set_bg(&mut self, x: i32, y: i32, bg: RGB)
[src]
fn draw_box(
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
fn draw_box_double(
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
fn draw_hollow_box(
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
fn draw_hollow_box_double(
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
x: i32,
y: i32,
width: i32,
height: i32,
fg: RGB,
bg: RGB
)
fn draw_bar_horizontal(
&mut self,
x: i32,
y: i32,
width: i32,
n: i32,
max: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
x: i32,
y: i32,
width: i32,
n: i32,
max: i32,
fg: RGB,
bg: RGB
)
fn draw_bar_vertical(
&mut self,
x: i32,
y: i32,
height: i32,
n: i32,
max: i32,
fg: RGB,
bg: RGB
)
[src]
&mut self,
x: i32,
y: i32,
height: i32,
n: i32,
max: i32,
fg: RGB,
bg: RGB
)
fn fill_region(&mut self, target: Rect, glyph: u8, fg: RGB, bg: RGB)
[src]
fn get(&self, x: i32, y: i32) -> Option<(&u8, &RGB, &RGB)>
[src]
fn print_centered(&mut self, y: i32, text: &str)
[src]
fn print_color_centered(&mut self, y: i32, fg: RGB, bg: RGB, text: &str)
[src]
fn to_xp_layer(&self) -> XpLayer
[src]
fn set_offset(&mut self, x: f32, y: f32)
[src]
fn as_any(&self) -> &dyn Any
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,