pub struct Story {
pub asset_id: AssetId,
pub title: String,
pub nodes: Vec<StoryNode>,
pub text_speed: f32,
pub scaffold: StoryScaffold,
pub save_key: String,
}Expand description
A compiled branching story graph, played at runtime by the story system.
A Story is normally produced by a StoryImport expansion
at build time rather than written by hand: the Markdown source compiles
into this graph plus the stage scaffolding (a single dialogue
Screen whose labels and sprites the story system mutates page by
page). All references are pre-resolved: dialog text is pre-wrapped,
speakers carry their display name and color, stage images carry their
on-canvas rectangle, and jump / choice targets are node indices into
nodes.
The story system reads the graph and drives the stage screen named
<name>_stage: it fills the dialogue and name-plate labels (revealing
text at text_speed), swaps the backdrop and portrait sprite textures,
shows the choice menu when a node ends in one, and plays page audio.
Clicking the stage (or pressing Space) advances; story:start restarts
from the first node.
Fields§
§asset_id: AssetIdAsset identity; injected via inject_name. Not part of args.
title: StringThe story title, as shown on the generated title screen.
nodes: Vec<StoryNode>The node graph in document order. Play starts at the first node; a node whose last page has no jump and no choices falls through to the next node, and the last node ends the story.
text_speed: f32Dialogue reveal speed in characters per second. 0 shows each page
instantly.
scaffold: StoryScaffoldThe generated stage assets the story system drives. All references are resolved to ids at build time, like every other cross-reference.
save_key: StringStable key naming this story’s save file (position + flags, auto-saved page by page under the project data directory). Empty disables saving.
Trait Implementations§
Source§impl Component for Story
impl Component for Story
Source§fn inject_name(&mut self, id: AssetId)
fn inject_name(&mut self, id: AssetId)
Source§fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Source§impl ComponentSlot for Story
impl ComponentSlot for Story
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.