#[non_exhaustive]pub struct AppConfig {
pub window: Window,
pub storage_name: &'static str,
pub files: fn(&str) -> Option<&'static [u8]>,
pub font_png: &'static str,
pub sounds: Files<'static>,
pub voices: Option<VoiceFiles>,
pub text_input: Option<Box<dyn TextInput>>,
pub crash: CrashReports,
}Expand description
What a game tells the macroquad backend. How it starts, loads and is
painted is its Start. Build it with AppConfig::new.
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.window: WindowThe window.
storage_name: &'static strThe storage’s name: the folder in the OS’s data folder on native
(storage::data_dir), the prefix of every localStorage key on
the web (storage::web_prefix). Changing it loses every save.
files: fn(&str) -> Option<&'static [u8]>The game’s embedded files by path: the images, the font atlas’s
picture and a loading card’s picture are read with it. Under cargo shuyi run --watch the folder of its files on disk lies over it
(watched_layer), and a picture saved there is drawn from then on.
font_png: &'static strThe font atlas’s picture: its path for files.
sounds: Files<'static>The sound files the audio manifest names, and the music folder shipped beside the game (not embedded).
voices: Option<VoiceFiles>Where the voice clips are; None for a game without voices.
text_input: Option<Box<dyn TextInput>>The system’s own keyboard for text, if the game’s build has one
(Steam’s on-screen keyboard is the game’s: its ticket 0903);
None where the player types on keys.
crash: CrashReportsWhether a panic writes a crash report, and the game’s version in it
(crash): reports with no version until the game assigns
CrashReports::new with its own, or CrashReports::off.
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub const fn new(
window: Window,
storage_name: &'static str,
files: fn(&str) -> Option<&'static [u8]>,
font_png: &'static str,
sounds: Files<'static>,
) -> Self
pub const fn new( window: Window, storage_name: &'static str, files: fn(&str) -> Option<&'static [u8]>, font_png: &'static str, sounds: Files<'static>, ) -> Self
The config of a game with every field it must choose, with no
voices and no system keyboard: a game that has them assigns
voices and text_input.