Struct bracket_lib::prelude::BTermBuilder
source · [−]pub struct BTermBuilder { /* private fields */ }
Expand description
Provides a builder mechanism for initializing BTerm. You can chain builders together,
and and with a call to .build()
. This allows you to provide settings if you want to,
or just use a simple initializer if you are in a hurry.
Implementations
sourceimpl BTermBuilder
impl BTermBuilder
sourcepub fn new() -> BTermBuilder
pub fn new() -> BTermBuilder
Provides a new, unconfigured, starting point for an BTerm session. You’ll have to specify everything manually.
sourcepub fn simple80x50() -> BTermBuilder
pub fn simple80x50() -> BTermBuilder
Provides an 80x50 console in the baked-in 8x8 terminal font as your starting point.
sourcepub fn simple<T>(
width: T,
height: T
) -> Result<BTermBuilder, Box<dyn Error + Sync + Send + 'static, Global>>where
T: TryInto<u32>,
pub fn simple<T>(
width: T,
height: T
) -> Result<BTermBuilder, Box<dyn Error + Sync + Send + 'static, Global>>where
T: TryInto<u32>,
Provides an 8x8 terminal font simple console, with the specified dimensions as your starting point.
sourcepub fn vga80x50() -> BTermBuilder
pub fn vga80x50() -> BTermBuilder
Provides an 80x50 terminal, in the VGA font as your starting point.
sourcepub fn vga<T>(width: T, height: T) -> BTermBuilderwhere
T: TryInto<u32>,
pub fn vga<T>(width: T, height: T) -> BTermBuilderwhere
T: TryInto<u32>,
Provides a VGA-font simple terminal with the specified dimensions as your starting point.
sourcepub fn with_dimensions<T>(self, width: T, height: T) -> BTermBuilderwhere
T: TryInto<u32>,
pub fn with_dimensions<T>(self, width: T, height: T) -> BTermBuilderwhere
T: TryInto<u32>,
Adds width/height dimensions to the BTerm builder.
sourcepub fn with_tile_dimensions<T>(self, width: T, height: T) -> BTermBuilderwhere
T: TryInto<u32>,
pub fn with_tile_dimensions<T>(self, width: T, height: T) -> BTermBuilderwhere
T: TryInto<u32>,
Overrides the default assumption for tile sizes. Needed for a raw initialization. If you have lots of fonts, the library will pick one (generally the first) to try and determine what dimensions you want to use when figuring out your window size. This method is used to override that assumption. It’s a great idea to use this when using multiple layers and fonts.
sourcepub fn with_title<S>(self, title: S) -> BTermBuilderwhere
S: ToString,
pub fn with_title<S>(self, title: S) -> BTermBuilderwhere
S: ToString,
Adds a window title to the BTerm builder.
sourcepub fn with_resource_path<S>(self, path: S) -> BTermBuilderwhere
S: ToString,
pub fn with_resource_path<S>(self, path: S) -> BTermBuilderwhere
S: ToString,
Adds a resource path to the BTerm builder. You only need to specify this if you aren’t embedding your resources.
sourcepub fn with_font<S, T>(self, font_path: S, width: T, height: T) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
pub fn with_font<S, T>(self, font_path: S, width: T, height: T) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
Adds a font registration to the BTerm builder.
sourcepub fn with_font_bg<S, T, COLOR>(
self,
font_path: S,
width: T,
height: T,
background: COLOR
) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
COLOR: Into<RGB>,
pub fn with_font_bg<S, T, COLOR>(
self,
font_path: S,
width: T,
height: T,
background: COLOR
) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
COLOR: Into<RGB>,
Adds a font registration to the BTerm builder.
sourcepub fn with_simple_console<S, T>(
self,
width: T,
height: T,
font: S
) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
pub fn with_simple_console<S, T>(
self,
width: T,
height: T,
font: S
) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
Adds a simple console layer to the BTerm builder.
sourcepub fn with_simple_console_no_bg<S, T>(
self,
width: T,
height: T,
font: S
) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
pub fn with_simple_console_no_bg<S, T>(
self,
width: T,
height: T,
font: S
) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
Adds a simple console layer to the BTerm builder, with no background.
sourcepub fn with_simple8x8(self) -> BTermBuilder
pub fn with_simple8x8(self) -> BTermBuilder
Adds a simple console, hard-coded to the baked-in 8x8 terminal font. This does NOT register the font.
sourcepub fn with_sparse_console<S, T>(
self,
width: T,
height: T,
font: S
) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
pub fn with_sparse_console<S, T>(
self,
width: T,
height: T,
font: S
) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
Adds a sparse console layer to the BTerm builder.
sourcepub fn with_sparse_console_no_bg<S, T>(
self,
width: T,
height: T,
font: S
) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
pub fn with_sparse_console_no_bg<S, T>(
self,
width: T,
height: T,
font: S
) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
Adds a sparse console with no bg rendering layer to the BTerm builder.
sourcepub fn with_fancy_console<S, T>(self, width: T, height: T, font: S) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
pub fn with_fancy_console<S, T>(self, width: T, height: T, font: S) -> BTermBuilderwhere
S: ToString,
T: TryInto<u32>,
Adds a fancy (supporting per-glyph offsets, rotation, etc.) console. OpenGL only for now.
sourcepub fn with_sprite_console<T>(
self,
width: T,
height: T,
sprite_sheet: usize
) -> BTermBuilderwhere
T: TryInto<u32>,
pub fn with_sprite_console<T>(
self,
width: T,
height: T,
sprite_sheet: usize
) -> BTermBuilderwhere
T: TryInto<u32>,
Adds a sprite console
sourcepub fn with_vsync(self, vsync: bool) -> BTermBuilder
pub fn with_vsync(self, vsync: bool) -> BTermBuilder
Enables you to override the vsync default for native rendering.
sourcepub fn with_fullscreen(self, fullscreen: bool) -> BTermBuilder
pub fn with_fullscreen(self, fullscreen: bool) -> BTermBuilder
Enables you to override the full screen setting for native rendering.
sourcepub fn with_fitscreen(self, fitscreen: bool) -> BTermBuilder
pub fn with_fitscreen(self, fitscreen: bool) -> BTermBuilder
Enables you to auto adjust the window to fit the screen.
sourcepub fn with_platform_specific(self, hints: InitHints) -> BTermBuilder
pub fn with_platform_specific(self, hints: InitHints) -> BTermBuilder
Push platform-specific initialization hints to the builder. THIS REMOVES CROSS-PLATFORM COMPATIBILITY
sourcepub fn with_fps_cap(self, fps: f32) -> BTermBuilder
pub fn with_fps_cap(self, fps: f32) -> BTermBuilder
Instructs the back-end (not all of them honor it; WASM and Amethyst do their own thing) to try to limit frame-rate and CPU utilization.
sourcepub fn with_advanced_input(self, advanced_input: bool) -> BTermBuilder
pub fn with_advanced_input(self, advanced_input: bool) -> BTermBuilder
Enables input event queue
sourcepub fn with_automatic_console_resize(self, resize_scaling: bool) -> BTermBuilder
pub fn with_automatic_console_resize(self, resize_scaling: bool) -> BTermBuilder
Enable resize changing console size, rather than scaling. Native OpenGL only.
sourcepub fn with_sprite_sheet(self, ss: SpriteSheet) -> BTermBuilder
pub fn with_sprite_sheet(self, ss: SpriteSheet) -> BTermBuilder
Register a sprite sheet
sourcepub fn with_gutter(self, desired_gutter: u32) -> BTermBuilder
pub fn with_gutter(self, desired_gutter: u32) -> BTermBuilder
Request a pixel gutter around the rendered area. The gutter is applied with half at each side of the screen, centering it. If you want a 4 pixel gutter on every side, request a gutter size of 8.