pub struct SceneGraph {Show 23 fields
pub width: u32,
pub height: u32,
pub theme: Theme,
pub tod: TimeOfDay,
pub buddy: bool,
pub seed: u64,
pub family: PaletteFamily,
pub grid: GridSpec,
pub cells: Vec<Cell>,
pub lighting: Lighting,
pub activity: Option<String>,
pub props: Vec<SpriteInstance>,
pub unattended: Vec<SpriteInstance>,
pub character: Option<CharacterTrack>,
pub emitters: Vec<Emitter>,
pub ground_y: i32,
pub t_hero_ms: u64,
pub loop_ms: u64,
pub pace: u8,
pub generator: u32,
pub water: Option<(i32, i32)>,
pub journey: Option<Journey>,
pub zoom: f64,
}Expand description
Everything needed to render one scene at one size and theme.
Fields§
§width: u32§height: u32§theme: Theme§tod: TimeOfDay§buddy: bool§seed: u64The recipe seed (drives the character’s state machine).
family: PaletteFamilyNot stored in scene packages (playback uses the package’s palette).
grid: GridSpec§cells: Vec<Cell>Row-major, grid.cols * grid.rows. Not stored in scene packages,
which keep the baked background instead.
lighting: Lighting§activity: Option<String>The activity id, or None for an archetype-first fallback scene.
props: Vec<SpriteInstance>Activity props, drawn in both Buddy states.
unattended: Vec<SpriteInstance>Unattended variant, drawn only with Buddy off.
character: Option<CharacterTrack>The character’s track (always laid out; drawn only with Buddy on).
emitters: Vec<Emitter>§ground_y: i32Pixel y of the platform’s top surface (where feet stand).
t_hero_ms: u64Hero time in milliseconds: the frame used for stills and thumbnails.
loop_ms: u64Seamless loop length for periodic elements.
pace: u8How fast particles and effects move (particles::CALM_PACE); 0 in
scenes saved before the calm pace, which keep their motion.
generator: u32The generator version that built it (0 in older saved scenes); the palette follows it, so older scenes keep their colours.
water: Option<(i32, i32)>A point on open water near the focal group, in pixels (the shore: just past the pier’s end), for effects that reach the water.
journey: Option<Journey>A travelling scene: layers that scroll past, ground under the feet.
zoom: f64The focal group’s size against the closest zoom (1, 1/2, 1/4): what reaches out from it (a kite’s string, a stone’s skips) scales too.
Implementations§
Source§impl SceneGraph
impl SceneGraph
pub fn cell(&self, col: u32, row: u32) -> Cell
Sourcepub fn sprites_at(&self, t_ms: u64) -> Vec<SpriteInstance>
pub fn sprites_at(&self, t_ms: u64) -> Vec<SpriteInstance>
Sprites to draw at t, back to front: props, then the character (Buddy
on) or the unattended variant (Buddy off).
Sourcepub fn on_ground(&self, s: SpriteInstance, t_ms: u64) -> SpriteInstance
pub fn on_ground(&self, s: SpriteInstance, t_ms: u64) -> SpriteInstance
The character placed for t_ms: on a journey its feet follow the
ground going by under them; otherwise unchanged.
Sourcepub fn particles_in_grid(&self, t_ms: u64) -> Vec<Particle>
pub fn particles_in_grid(&self, t_ms: u64) -> Vec<Particle>
Particles at time t that fall inside the grid, at their own pixel
positions (particle.x, particle.y are their centres).