#[non_exhaustive]pub enum SystemEvent {
Suspend,
Resume,
FocusLost,
FocusGained,
QuitRequested,
LowBattery,
ToggleFullscreen,
CrankDocked,
CrankUndocked,
}Expand description
Something the system tells the game, between frames.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Suspend
The game is about to stop running for a while: the device sleeps or
locks, the system’s home menu opens, the app goes to the
background. App lets the game save and stops
stepping it until Resume.
Resume
The game runs again. App forgets the time it was
away, so the sleep doesn’t become a burst of catch-up steps.
FocusLost
The game’s window lost the player’s attention (another window, an overlay over it). The game keeps running; its hook may pause it.
FocusGained
The game’s window has the player’s attention again.
QuitRequested
The player asked the system to close the game (the window’s close
button). App lets the game save, then quits.
LowBattery
The battery is nearly empty: the game may save in case the device turns off.
ToggleFullscreen
The window’s own fullscreen shortcut was pressed (F11, Alt+Enter):
App flips the Fullscreen setting, so the next frame
asks for the other window mode and an options screen shows it.
CrankDocked
The device’s crank was folded away, or was already when the game
loaded: a screen whose required action is on the crank shows a hint
to unfold it (Ctx::crank_docked).
CrankUndocked
The device’s crank was unfolded.
Trait Implementations§
Source§impl Clone for SystemEvent
impl Clone for SystemEvent
Source§fn clone(&self) -> SystemEvent
fn clone(&self) -> SystemEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more