Struct bottomless_pit::engine_handle::EngineBuilder
source · pub struct EngineBuilder { /* private fields */ }Expand description
The main entry point for the Engine
Implementations§
source§impl EngineBuilder
impl EngineBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a builder with some defualt presets
Self {
resolution: (600, 600),
full_screen: false,
target_fps: 30,
close_key: None,
clear_colour: Colour::Black,
window_icon: None,
window_title: "".into(),
resizable: true,
}sourcepub fn with_resolution(self, resolution: (u32, u32)) -> Self
pub fn with_resolution(self, resolution: (u32, u32)) -> Self
Overides the defualt resolution
sourcepub fn fullscreen(self) -> Self
pub fn fullscreen(self) -> Self
Will cause the window to be fullscreen upon launch
sourcepub fn set_target_fps(self, fps: u32) -> Self
pub fn set_target_fps(self, fps: u32) -> Self
Currently does nothing
sourcepub fn set_close_key(self, key: Key) -> Self
pub fn set_close_key(self, key: Key) -> Self
Sets a key that will instantly close the window
sourcepub fn set_clear_colour(self, colour: Colour) -> Self
pub fn set_clear_colour(self, colour: Colour) -> Self
Sets the colour that the background will be
sourcepub fn set_window_title(self, title: &str) -> Self
pub fn set_window_title(self, title: &str) -> Self
Sets the title of the window
sourcepub fn set_window_icon(self, icon: Icon) -> Self
pub fn set_window_icon(self, icon: Icon) -> Self
Sets the window icon
sourcepub fn unresizable(self) -> Self
pub fn unresizable(self) -> Self
Prevents the window from being resized during runtime
sourcepub fn build(self) -> Result<Engine, BuildError>
pub fn build(self) -> Result<Engine, BuildError>
Attempts to buld the Engine
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for EngineBuilder
impl Send for EngineBuilder
impl Sync for EngineBuilder
impl Unpin for EngineBuilder
impl UnwindSafe for EngineBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more