pub struct Settings<S: GameSettings> {
pub text_speed: TextSpeed,
pub fullscreen: bool,
pub theme: S::Theme,
pub music_volume: u8,
pub sound_volume: u8,
pub voices: bool,
pub voice_volume: u8,
pub frame_cap: FrameCap,
pub game: S,
/* private fields */
}Expand description
Everything an options screen sets: the engine’s settings and the game’s. The defaults are a new player’s.
Fields§
§text_speed: TextSpeedHow fast dialogue text is revealed.
fullscreen: boolWhether the game fills the screen.
theme: S::ThemeThe color theme: the palette the game draws with.
music_volume: u8Music volume, 0 (silent) to MAX_VOLUME.
sound_volume: u8Sound volume, 0 (silent) to MAX_VOLUME.
voices: boolWhether voice clips play
(Ctx::play_voice). Turning it off stops
the one playing.
voice_volume: u8Voice volume, 0 (silent) to MAX_VOLUME.
frame_cap: FrameCapThe most frames a second the platform shows: the game’s
GameSettings::DEFAULT_FRAME_CAP until the player picks another.
Every change of it takes the next serial, which the platform reports
once it has applied it; a game that wants to know when asks with
Ctx::request_frame_cap.
game: SThe game’s own settings.
Implementations§
Source§impl<S: GameSettings> Settings<S>
impl<S: GameSettings> Settings<S>
Sourcepub fn with_layout(self, layout: Layout) -> Self
pub fn with_layout(self, layout: Layout) -> Self
The same settings with layout as the one picked.
Sourcepub fn with_layout_of(self, other: &Self) -> Self
pub fn with_layout_of(self, other: &Self) -> Self
The same settings with other’s layout picked (or none): to
compare two settings but for the layout.
Sourcepub fn restored(&self) -> Self
pub fn restored(&self) -> Self
The defaults, keeping what isn’t a preference with a default: the layout picked (an options screen’s “Restore defaults”).
Sourcepub fn music_factor(&self) -> f32
pub fn music_factor(&self) -> f32
The multiplier on the music’s volume, 0–1.
Sourcepub fn sound_factor(&self) -> f32
pub fn sound_factor(&self) -> f32
The multiplier on every sound’s volume, 0–1.
Sourcepub fn voice_factor(&self) -> f32
pub fn voice_factor(&self) -> f32
The multiplier on every voice clip’s volume, 0–1.
Sourcepub fn to_ron(&self) -> String
pub fn to_ron(&self) -> String
The saved form (GameSettings::to_ron).