#[non_exhaustive]pub struct PlatformFacts {
pub target: String,
pub quit: Quit,
pub windowed: bool,
pub keyboard: Keyboard,
pub pointer: bool,
pub touch: bool,
pub device: Option<Device>,
}Expand description
Where the game runs: its target’s id, and what that target lets a game do and the player press.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.target: StringThe target’s id, as its profile names it (desktop, web,
steam-deck, playdate).
quit: QuitHow the player leaves the game: by its own Quit, or through the
system (can_quit).
windowed: boolWhether the game is in a window the player can switch to full screen and back. Where it isn’t, the Fullscreen setting does nothing, and the engine’s options screen leaves its row out.
keyboard: KeyboardWhether the device has a keyboard: without one the game’s first-key screen never opens, and the key bindings screen shows the controller’s alone.
pointer: boolWhether a mouse or another pointer exists.
touch: boolWhether a touch screen exists.
device: Option<Device>The device the player holds, where the target has just the one: help
text names its buttons from the first frame, before any press
(Ctx::device). None where it isn’t known
until something is pressed.
Implementations§
Source§impl PlatformFacts
impl PlatformFacts
Sourcepub fn from_profile(profile: &TargetProfile) -> Self
pub fn from_profile(profile: &TargetProfile) -> Self
The facts of the target profile describes.
Sourcepub fn with_device(self, device: Device) -> Self
pub fn with_device(self, device: Device) -> Self
The same facts on a target whose player holds device.
Trait Implementations§
Source§impl Clone for PlatformFacts
impl Clone for PlatformFacts
Source§fn clone(&self) -> PlatformFacts
fn clone(&self) -> PlatformFacts
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more