pub struct Game<State, Update> { /* private fields */ }
Expand description
Tells the engine how to run a game.
This is returned by baba::game
and you can modify settings with the available
methods below.
Implementations§
Source§impl<State, Update: Fn(&mut State)> Game<State, Update>
impl<State, Update: Fn(&mut State)> Game<State, Update>
Sourcepub fn scale_mode(self, scale_mode: ScaleMode) -> Self
pub fn scale_mode(self, scale_mode: ScaleMode) -> Self
Sets the default scaling for textures. Defaults to nearest scaling.
Sourcepub fn framerate(self, framerate: Framerate) -> Self
pub fn framerate(self, framerate: Framerate) -> Self
Sets the framerate limit. Defaults to 1x the display refresh rate.
Sourcepub fn window_title(self, title: impl Into<String>) -> Self
pub fn window_title(self, title: impl Into<String>) -> Self
Sourcepub fn window_size(self, width: u32, height: u32) -> Self
pub fn window_size(self, width: u32, height: u32) -> Self
Sets the window size. Defaults to 800x600.
Sourcepub fn settings(self, settings: Settings) -> Self
pub fn settings(self, settings: Settings) -> Self
Set the engine settings.
This will override any other methods.
Sourcepub fn window(self, settings: WindowSettings) -> Self
pub fn window(self, settings: WindowSettings) -> Self
Sets all window settings.
Overrides any other window_*
methods.
Auto Trait Implementations§
impl<State, Update> Freeze for Game<State, Update>where
Update: Freeze,
impl<State, Update> RefUnwindSafe for Game<State, Update>where
Update: RefUnwindSafe,
State: RefUnwindSafe,
impl<State, Update> Send for Game<State, Update>
impl<State, Update> Sync for Game<State, Update>
impl<State, Update> Unpin for Game<State, Update>
impl<State, Update> UnwindSafe for Game<State, Update>where
Update: UnwindSafe,
State: UnwindSafe,
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