Skip to main content

Module app_info

Module app_info 

Source
Expand description

AppInfo: who a game is, the same on every target: the name players see, a reverse-DNS id, its version and build, its publisher, the name its saves are kept under (ADR-0059), and its window’s icon (WindowIcon, ADR-0061).

A game writes it once, in its shuyi.ron’s app part, and shuyi app-info writes it as a Rust constant (pub const APP: AppInfo) its binary compiles. A game that keeps its own builds it here in a const item:

use shuyi_platform::AppInfo;

const APP: AppInfo = AppInfo::new("Moon Garden", "com.example.moon-garden", "0.1.0")
    .with_storage("moon_garden")
    .with_publisher("Moon Garden's makers");

assert_eq!((APP.storage, APP.build), ("moon_garden", 1));

Structs§

AppInfo
Who a game is. Build it with AppInfo::new and the with_ setters: a struct literal doesn’t compile outside this crate, so a new field never breaks a game (ADR-0039).
WindowIcon
A window’s icon: PNG files of 16, 32 and 64 pixels square, which shuyi app-info downscales from the game’s one icon (ADR-0061). Build it with WindowIcon::new.