Skip to content

author

@fungi.computer/sprite-zdog


@fungi.computer/sprite-zdog / author

An opaque node in a renderer-neutral Sprite scene.

readonly __sceneNodeBrand: typeof __sceneNodeBrand

Nominal marker that keeps renderer details out of the author surface.


A point in Sprite scene space.

readonly x: number

Horizontal scene coordinate.

readonly y: number

Vertical scene coordinate.

readonly optional z?: number

Optional depth coordinate.


One cubic Bezier path segment.

readonly bezier: readonly [Point, Point, Point]

Two control points followed by the segment endpoint.


Optional translation, rotation, or scale coordinates.

readonly optional x?: number

Optional horizontal component.

readonly optional y?: number

Optional vertical component.

readonly optional z?: number

Optional depth component.


Shared renderer-neutral options for one scene node.

readonly optional name?: string

Definition-local name used by authored references.

readonly optional parent?: SceneNode

Parent node in the same definition.

readonly optional x?: number

Horizontal translation that takes precedence over translate.x.

readonly optional y?: number

Vertical translation that takes precedence over translate.y.

readonly optional z?: number

Depth translation that takes precedence over translate.z.

readonly optional translate?: Transform

Translation components not supplied by the direct coordinates.

readonly optional rotate?: Transform

Rotation around each scene axis, in radians.

readonly optional scale?: Transform

Scale applied along each scene axis.

readonly optional visible?: boolean

Whether the node participates in rendering.

readonly optional color?: string

Literal paint or an opaque reference returned by color.

readonly optional stroke?: number | false

A false stroke keeps a solid primitive edge-free, as in Zdog fills.

readonly optional fill?: boolean

readonly optional backface?: string

Optional rear/forward surface palette slots for 3D solids.

readonly optional frontFace?: string

Paint used for a primitive’s front face when supported.

readonly optional updateSort?: boolean

Whether supported primitives update child depth ordering.


Renderer-neutral options for a freeform shape.

readonly optional name?: string

Definition-local name used by authored references.

SceneNodeOptions.name

readonly optional parent?: SceneNode

Parent node in the same definition.

SceneNodeOptions.parent

readonly optional x?: number

Horizontal translation that takes precedence over translate.x.

SceneNodeOptions.x

readonly optional y?: number

Vertical translation that takes precedence over translate.y.

SceneNodeOptions.y

readonly optional z?: number

Depth translation that takes precedence over translate.z.

SceneNodeOptions.z

readonly optional translate?: Transform

Translation components not supplied by the direct coordinates.

SceneNodeOptions.translate

readonly optional rotate?: Transform

Rotation around each scene axis, in radians.

SceneNodeOptions.rotate

readonly optional scale?: Transform

Scale applied along each scene axis.

SceneNodeOptions.scale

readonly optional visible?: boolean

Whether the node participates in rendering.

SceneNodeOptions.visible

readonly optional color?: string

Literal paint or an opaque reference returned by color.

SceneNodeOptions.color

readonly optional stroke?: number | false

A false stroke keeps a solid primitive edge-free, as in Zdog fills.

SceneNodeOptions.stroke

readonly optional fill?: boolean

SceneNodeOptions.fill

readonly optional backface?: string

Optional rear/forward surface palette slots for 3D solids.

SceneNodeOptions.backface

readonly optional frontFace?: string

Paint used for a primitive’s front face when supported.

SceneNodeOptions.frontFace

readonly optional updateSort?: boolean

Whether supported primitives update child depth ordering.

SceneNodeOptions.updateSort

readonly optional path?: readonly ShapePathStep[]

Ordered points and cubic Bezier segments in the path.

readonly optional closed?: boolean

Whether the renderer closes the path.


Renderer-neutral options for an ellipse.

readonly optional name?: string

Definition-local name used by authored references.

SceneNodeOptions.name

readonly optional parent?: SceneNode

Parent node in the same definition.

SceneNodeOptions.parent

readonly optional x?: number

Horizontal translation that takes precedence over translate.x.

SceneNodeOptions.x

readonly optional y?: number

Vertical translation that takes precedence over translate.y.

SceneNodeOptions.y

readonly optional z?: number

Depth translation that takes precedence over translate.z.

SceneNodeOptions.z

readonly optional translate?: Transform

Translation components not supplied by the direct coordinates.

SceneNodeOptions.translate

readonly optional rotate?: Transform

Rotation around each scene axis, in radians.

SceneNodeOptions.rotate

readonly optional scale?: Transform

Scale applied along each scene axis.

SceneNodeOptions.scale

readonly optional visible?: boolean

Whether the node participates in rendering.

SceneNodeOptions.visible

readonly optional color?: string

Literal paint or an opaque reference returned by color.

SceneNodeOptions.color

readonly optional stroke?: number | false

A false stroke keeps a solid primitive edge-free, as in Zdog fills.

SceneNodeOptions.stroke

readonly optional fill?: boolean

SceneNodeOptions.fill

readonly optional backface?: string

Optional rear/forward surface palette slots for 3D solids.

SceneNodeOptions.backface

readonly optional frontFace?: string

Paint used for a primitive’s front face when supported.

SceneNodeOptions.frontFace

readonly optional updateSort?: boolean

Whether supported primitives update child depth ordering.

SceneNodeOptions.updateSort

readonly width: number

Horizontal diameter.

readonly height: number

Vertical diameter.


Renderer-neutral options for a hemisphere.

readonly optional name?: string

Definition-local name used by authored references.

SceneNodeOptions.name

readonly optional parent?: SceneNode

Parent node in the same definition.

SceneNodeOptions.parent

readonly optional x?: number

Horizontal translation that takes precedence over translate.x.

SceneNodeOptions.x

readonly optional y?: number

Vertical translation that takes precedence over translate.y.

SceneNodeOptions.y

readonly optional z?: number

Depth translation that takes precedence over translate.z.

SceneNodeOptions.z

readonly optional translate?: Transform

Translation components not supplied by the direct coordinates.

SceneNodeOptions.translate

readonly optional rotate?: Transform

Rotation around each scene axis, in radians.

SceneNodeOptions.rotate

readonly optional scale?: Transform

Scale applied along each scene axis.

SceneNodeOptions.scale

readonly optional visible?: boolean

Whether the node participates in rendering.

SceneNodeOptions.visible

readonly optional color?: string

Literal paint or an opaque reference returned by color.

SceneNodeOptions.color

readonly optional stroke?: number | false

A false stroke keeps a solid primitive edge-free, as in Zdog fills.

SceneNodeOptions.stroke

readonly optional fill?: boolean

SceneNodeOptions.fill

readonly optional backface?: string

Optional rear/forward surface palette slots for 3D solids.

SceneNodeOptions.backface

readonly optional frontFace?: string

Paint used for a primitive’s front face when supported.

SceneNodeOptions.frontFace

readonly optional updateSort?: boolean

Whether supported primitives update child depth ordering.

SceneNodeOptions.updateSort

readonly diameter: number

Diameter of the hemisphere’s base.


Renderer-neutral options for a cylinder.

readonly optional name?: string

Definition-local name used by authored references.

SceneNodeOptions.name

readonly optional parent?: SceneNode

Parent node in the same definition.

SceneNodeOptions.parent

readonly optional x?: number

Horizontal translation that takes precedence over translate.x.

SceneNodeOptions.x

readonly optional y?: number

Vertical translation that takes precedence over translate.y.

SceneNodeOptions.y

readonly optional z?: number

Depth translation that takes precedence over translate.z.

SceneNodeOptions.z

readonly optional translate?: Transform

Translation components not supplied by the direct coordinates.

SceneNodeOptions.translate

readonly optional rotate?: Transform

Rotation around each scene axis, in radians.

SceneNodeOptions.rotate

readonly optional scale?: Transform

Scale applied along each scene axis.

SceneNodeOptions.scale

readonly optional visible?: boolean

Whether the node participates in rendering.

SceneNodeOptions.visible

readonly optional color?: string

Literal paint or an opaque reference returned by color.

SceneNodeOptions.color

readonly optional stroke?: number | false

A false stroke keeps a solid primitive edge-free, as in Zdog fills.

SceneNodeOptions.stroke

readonly optional fill?: boolean

SceneNodeOptions.fill

readonly optional backface?: string

Optional rear/forward surface palette slots for 3D solids.

SceneNodeOptions.backface

readonly optional frontFace?: string

Paint used for a primitive’s front face when supported.

SceneNodeOptions.frontFace

readonly optional updateSort?: boolean

Whether supported primitives update child depth ordering.

SceneNodeOptions.updateSort

readonly diameter: number

Diameter of the cylinder’s circular faces.

readonly length: number

Distance between the cylinder’s faces.


The complete renderer-neutral scene authoring surface.

group(options?): SceneNode

Create a grouping node.

SceneNodeOptions

SceneNode

shape(options): SceneNode

Create a freeform path node.

ShapeOptions

SceneNode

ellipse(options): SceneNode

Create an ellipse node.

EllipseOptions

SceneNode

hemisphere(options): SceneNode

Create a hemisphere node.

HemisphereOptions

SceneNode

cylinder(options): SceneNode

Create a cylinder node.

CylinderOptions

SceneNode


A named motion applied while presenting a Sprite.

readonly target: string

Name of the scene node targeted by the motion.

readonly optional translate?: Transform

Authored translation change.

readonly optional rotate?: Transform

Authored rotation change.

readonly optional durationMs?: number

Duration of one motion pass in milliseconds.

readonly optional repeat?: "none" | "loop" | "yoyo"

Repetition mode for the motion.


Variant selections applied to one expression or activity.

readonly optional expression?: string

Expression selected by an activity.

readonly optional eyes?: string

Value selected from the eyes variant channel.

readonly optional mouth?: string

Value selected from the mouth variant channel.

readonly optional blush?: number

Normalized blush intensity.


One timed mouth state in a speaking cycle.

readonly durationMs: number

Time spent in this mouth state, in milliseconds.

readonly mouth: "base" | "open"

Mouth state shown during the step.


Presentation behavior associated with an activity.

readonly optional motion?: MotionSpec

Optional motion authored for the activity.

readonly optional geometry?: StateGeometry

Optional geometry selections authored for the activity.

readonly optional mouseInfluence?: number

Authored pointer-influence strength.

readonly optional mouthCycle?: readonly MouthCycleStep[]

Ordered timed mouth states for the activity.


Variant and motion behavior associated with an expression.

readonly optional variants?: Record<string, string>>

Fixed value selected for each variant channel.

readonly optional variantChoices?: Record<string, readonly string[]>

Candidate values authored for each variant channel.

readonly optional blush?: number

Normalized blush intensity.

readonly optional motion?: MotionSpec

Optional motion authored for the expression.


The root and named variants produced by one author build.

readonly root: SceneNode

Root node of the rendered scene tree.

readonly optional variants?: Record<string, Record<string, SceneNode>>>>

Definition-local nodes grouped by variant channel and value.


Renderer-neutral capabilities available while authoring a Sprite.

readonly scene: SceneBuilder

Scene builder valid only for the duration of build.

readonly color: (name) => string

Create an opaque reference to an own palette slot.

string

string


Input accepted by the Sprite authoring seam.

readonly apiVersion: 1

Version of the authoring contract used by this definition.

readonly name: string

Human-readable Sprite definition name.

readonly palette: Record<string, string>>

Named default paints available to the author callback.

readonly build: (context) => BuildResult

Construct the renderer-neutral scene and its named variants.

AuthorContext

BuildResult

readonly expressions: Record<string, ExpressionSpec>>

Named expression specifications; at least one is required.

readonly optional activities?: Record<string, ActivitySpec>>

Optional custom activity specifications.

readonly optional defaultPresentation?: object

Initial activity and expression selected when mounted.

readonly optional activity?: string

Standard or custom activity selected initially.

readonly optional expression?: string

Declared expression selected initially.


A compact receipt describing one already-authored Sprite definition.

readonly valid: true

Whether the definition has completed author-time validation.

readonly name: string

Human-readable name of the checked definition.

readonly nodeCount: number

Number of scene nodes reachable from the definition root.

readonly expressions: readonly string[]

Expression names in author insertion order.

readonly activities: readonly string[]

Standard activities followed by unique custom activities in author order.

readonly variants: Readonly<Record<string, readonly string[]>>

Variant values by channel, preserving author insertion order.

ShapePathStep = Point | BezierStep

One renderer-neutral shape path segment.


StandardActivity = "idle" | "listening" | "processing" | "speaking" | "thinking" | "error"

The standard presentation activity names accepted by every Sprite.


SpriteDefinition<Input> > = Readonly<Input>>

An authored Sprite definition preserving the author’s input shape.

Input extends SpriteDefinitionInput = SpriteDefinitionInput

const STANDARD_ACTIVITIES: readonly ["idle", "listening", "processing", "speaking", "thinking", "error"]

The standard presentation activities every Sprite understands.

defineSprite<Input>>(input): SpriteDefinition<Input>>

Validate and freeze one renderer-neutral Sprite definition.

Input extends SpriteDefinitionInput

Input

SpriteDefinition<Input>


check(definition): SpriteCheckResult

Return a compact, machine-readable receipt for an already authored definition.

SpriteDefinition

SpriteCheckResult

Re-exports toCharacter