pub struct ScenePackage {
pub recipe: SceneRecipe,
pub width: u32,
pub height: u32,
pub generator_version: u32,
/* private fields */
}Expand description
A frozen scene: plays without the generator.
Fields§
§recipe: SceneRecipe§width: u32§height: u32§generator_version: u32The generator that made it (for information; playback ignores it).
Implementations§
Source§impl ScenePackage
impl ScenePackage
Sourcepub fn capture(
recipe: &SceneRecipe,
width: u32,
height: u32,
) -> Result<Self, BuildError>
pub fn capture( recipe: &SceneRecipe, width: u32, height: u32, ) -> Result<Self, BuildError>
Builds the scene in every theme it supports and freezes the result.
Sourcepub fn capture_with(
recipe: &SceneRecipe,
width: u32,
height: u32,
catalog: &Catalog,
character: &dyn Character,
) -> Result<Self, BuildError>
pub fn capture_with( recipe: &SceneRecipe, width: u32, height: u32, catalog: &Catalog, character: &dyn Character, ) -> Result<Self, BuildError>
capture with another activity catalog and character
(the developer preview loads both from disk).
Sourcepub fn journey_bytes(&self, theme: Theme) -> usize
pub fn journey_bytes(&self, theme: Theme) -> usize
Bytes a journey’s baked layers take in a theme (baking them now), 0 for a scene that stays put.
Sourcepub fn keep_only(&mut self, theme: Theme)
pub fn keep_only(&mut self, theme: Theme)
Keeps only theme (when the scene has it): a wallpaper on screen
plays one, and each theme carries a full-size background and its
own layout. Saved after this, the package has only that theme.
Sourcepub fn frame(
&self,
theme: Theme,
buddy: bool,
t_ms: u64,
clock: Clock,
) -> Option<(IndexedImage, &IndexedPalette)>
pub fn frame( &self, theme: Theme, buddy: bool, t_ms: u64, clock: Clock, ) -> Option<(IndexedImage, &IndexedPalette)>
One frame, or None if the scene has no such theme.
Sourcepub fn incremental(&self, theme: Theme) -> Option<IncrementalFrame>
pub fn incremental(&self, theme: Theme) -> Option<IncrementalFrame>
A frame to play the scene live, starting from the bare background;
move it with ScenePackage::advance.
Sourcepub fn advance(
&self,
frame: &mut IncrementalFrame,
theme: Theme,
buddy: bool,
t_ms: u64,
clock: Clock,
) -> Option<Vec<PixelRect>>
pub fn advance( &self, frame: &mut IncrementalFrame, theme: Theme, buddy: bool, t_ms: u64, clock: Clock, ) -> Option<Vec<PixelRect>>
Moves a live frame to t_ms and returns the rectangles that changed;
the frame then equals ScenePackage::frame at that time.
Sourcepub fn still(
&self,
theme: Theme,
buddy: bool,
) -> Option<(IndexedImage, &IndexedPalette)>
pub fn still( &self, theme: Theme, buddy: bool, ) -> Option<(IndexedImage, &IndexedPalette)>
The still (hero) frame in a theme.
Sourcepub fn palette(&self, theme: Theme) -> Option<&IndexedPalette>
pub fn palette(&self, theme: Theme) -> Option<&IndexedPalette>
The palette in a theme.
Sourcepub fn graph(&self, theme: Theme) -> Option<&SceneGraph>
pub fn graph(&self, theme: Theme) -> Option<&SceneGraph>
The scene graph in a theme (layout, emitters, loop length).
Sourcepub fn save(&self, dir: &Path) -> Result<(), PackageError>
pub fn save(&self, dir: &Path) -> Result<(), PackageError>
Writes the package into dir (created if needed).
Sourcepub fn load(dir: &Path) -> Result<Self, PackageError>
pub fn load(dir: &Path) -> Result<Self, PackageError>
Reads a package written by this or an older version.