pub trait GameSettings:
Debug
+ Clone
+ PartialEq
+ Eq
+ Default
+ 'static {
type Theme: Debug + Copy + PartialEq + Eq + Default + 'static;
const DEFAULT_FRAME_CAP: FrameCap = FrameCap::DEFAULT;
const FRAME_CAP_CHOICES: &'static [FrameCap] = _;
const BACKGROUND: Background = Background::KEEP_RUNNING;
// Required methods
fn to_ron(settings: &Settings<Self>) -> String;
fn from_ron(text: &str) -> Result<Settings<Self>, String>;
}Expand description
The settings a game adds to the engine’s, and the saved form of both: one record, so the game decides its form (and keeps the one it has always written).
Provided Associated Constants§
Sourceconst DEFAULT_FRAME_CAP: FrameCap = FrameCap::DEFAULT
const DEFAULT_FRAME_CAP: FrameCap = FrameCap::DEFAULT
The frame cap a new player starts with
(Settings::frame_cap): 60 frames a second unless the game says
otherwise (FrameCap says why).
Sourceconst FRAME_CAP_CHOICES: &'static [FrameCap] = _
const FRAME_CAP_CHOICES: &'static [FrameCap] = _
The frame caps the options screen’s Frame rate row steps through,
in order (OptionRow::frame_cap):
30, 60, 120, 144, 165 and 240 frames a second, then none, unless the
game says otherwise (frame_cap::CHOICES).
Sourceconst BACKGROUND: Background = Background::KEEP_RUNNING
const BACKGROUND: Background = Background::KEEP_RUNNING
What the game does while its window has no focus (ADR-0077): it
keeps running with its sound (Background::KEEP_RUNNING) unless
the game says otherwise.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl GameSettings for ()
No settings of the game’s own, and one palette: the engine’s settings
alone, saved as one record (Settings(text_speed: Fast, …)).
impl GameSettings for ()
No settings of the game’s own, and one palette: the engine’s settings
alone, saved as one record (Settings(text_speed: Fast, …)).