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§
Source§impl BTermBuilder
impl BTermBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Provides a new, unconfigured, starting point for an BTerm session. You’ll have to specify everything manually.
Sourcepub fn simple80x50() -> Self
pub fn simple80x50() -> Self
Provides an 80x50 console in the baked-in 8x8 terminal font as your starting point.
Sourcepub fn simple<T>(width: T, height: T) -> BResult<Self>
pub fn simple<T>(width: T, height: T) -> BResult<Self>
Provides an 8x8 terminal font simple console, with the specified dimensions as your starting point.
Sourcepub fn vga<T>(width: T, height: T) -> Self
pub fn vga<T>(width: T, height: T) -> Self
Provides a VGA-font simple terminal with the specified dimensions as your starting point.
Sourcepub fn with_dimensions<T>(self, width: T, height: T) -> Self
pub fn with_dimensions<T>(self, width: T, height: T) -> Self
Adds width/height dimensions to the BTerm builder.
Sourcepub fn with_tile_dimensions<T>(self, width: T, height: T) -> Self
pub fn with_tile_dimensions<T>(self, width: T, height: T) -> Self
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: ToString>(self, title: S) -> Self
pub fn with_title<S: ToString>(self, title: S) -> Self
Adds a window title to the BTerm builder.
Sourcepub fn with_resource_path<S: ToString>(self, path: S) -> Self
pub fn with_resource_path<S: ToString>(self, path: S) -> Self
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: ToString, T>(
self,
font_path: S,
width: T,
height: T,
) -> Self
pub fn with_font<S: ToString, T>( self, font_path: S, width: T, height: T, ) -> Self
Adds a font registration to the BTerm builder.
Sourcepub fn with_font_bg<S: ToString, T, COLOR>(
self,
font_path: S,
width: T,
height: T,
background: COLOR,
) -> Self
pub fn with_font_bg<S: ToString, T, COLOR>( self, font_path: S, width: T, height: T, background: COLOR, ) -> Self
Adds a font registration to the BTerm builder.
Sourcepub fn with_simple_console<S: ToString, T>(
self,
width: T,
height: T,
font: S,
) -> Self
pub fn with_simple_console<S: ToString, T>( self, width: T, height: T, font: S, ) -> Self
Adds a simple console layer to the BTerm builder.
Sourcepub fn with_simple_console_no_bg<S: ToString, T>(
self,
width: T,
height: T,
font: S,
) -> Self
pub fn with_simple_console_no_bg<S: ToString, T>( self, width: T, height: T, font: S, ) -> Self
Adds a simple console layer to the BTerm builder, with no background.
Sourcepub fn with_simple8x8(self) -> Self
pub fn with_simple8x8(self) -> Self
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: ToString, T>(
self,
width: T,
height: T,
font: S,
) -> Self
pub fn with_sparse_console<S: ToString, T>( self, width: T, height: T, font: S, ) -> Self
Adds a sparse console layer to the BTerm builder.
Sourcepub fn with_sparse_console_no_bg<S: ToString, T>(
self,
width: T,
height: T,
font: S,
) -> Self
pub fn with_sparse_console_no_bg<S: ToString, T>( self, width: T, height: T, font: S, ) -> Self
Adds a sparse console with no bg rendering layer to the BTerm builder.
Sourcepub fn with_fancy_console<S: ToString, T>(
self,
width: T,
height: T,
font: S,
) -> Self
pub fn with_fancy_console<S: ToString, T>( self, width: T, height: T, font: S, ) -> Self
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,
) -> Self
pub fn with_sprite_console<T>( self, width: T, height: T, sprite_sheet: usize, ) -> Self
Adds a sprite console
Sourcepub fn with_vsync(self, vsync: bool) -> Self
pub fn with_vsync(self, vsync: bool) -> Self
Enables you to override the vsync default for native rendering.
Sourcepub fn with_fullscreen(self, fullscreen: bool) -> Self
pub fn with_fullscreen(self, fullscreen: bool) -> Self
Enables you to override the full screen setting for native rendering.
Sourcepub fn with_fitscreen(self, fitscreen: bool) -> Self
pub fn with_fitscreen(self, fitscreen: bool) -> Self
Enables you to auto adjust the window to fit the screen.
Sourcepub fn with_platform_specific(self, hints: InitHints) -> Self
pub fn with_platform_specific(self, hints: InitHints) -> Self
Push platform-specific initialization hints to the builder. THIS REMOVES CROSS-PLATFORM COMPATIBILITY
Sourcepub fn with_fps_cap(self, fps: f32) -> Self
pub fn with_fps_cap(self, fps: f32) -> Self
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) -> Self
pub fn with_advanced_input(self, advanced_input: bool) -> Self
Enables input event queue
Sourcepub fn with_automatic_console_resize(self, resize_scaling: bool) -> Self
pub fn with_automatic_console_resize(self, resize_scaling: bool) -> Self
Enable resize changing console size, rather than scaling. Native OpenGL only.
Sourcepub fn with_sprite_sheet(self, ss: SpriteSheet) -> Self
pub fn with_sprite_sheet(self, ss: SpriteSheet) -> Self
Register a sprite sheet
Sourcepub fn with_gutter(self, desired_gutter: u32) -> Self
pub fn with_gutter(self, desired_gutter: u32) -> Self
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.