Skip to content

Animation support #39

@nixonyh

Description

@nixonyh

Summary

Add animation support: time-driven value changes (easing/tweens) that update element fields each frame and mark the affected subtree dirty, integrating with the reactive + dirty machinery introduced with reactive scopes.

Motivation

Reactive scopes rebuild a subtree when an input changes. Animations are the continuous counterpart: a value interpolates over time (position, color, opacity, size), updating element fields every frame for some duration and marking those elements dirty so they re-layout/re-render.

Sketch / open questions

  • Granularity: per-field animators (animate a single field_accessor-addressed field) vs an "animation scope" that re-runs a builder each frame. Per-field is likely lighter and composes with the existing field_path accessors.
  • Clock / delta-time source: the harness already supplies per-frame dt to demos via the FynixDemo::update(world, dt) hook (examples/vello_winit_examples). A core clock/Time resource is probably needed so the framework can drive animators without demo plumbing.
  • Dirty integration: advancing an animation should call Elements::mark_dirty on the animated element so it re-layouts/renders; this depends on proper dirty propagation (see Track element depth for depth-ordered scope updates and layout #38).
  • Lifecycle: start/stop/loop/reverse, completion callbacks, and removing finished animators.
  • Easing: a small set of easing curves (linear, quad, cubic, etc.).

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions