Skip to content

Core Concepts: EffectClips, Layers, and Bindings

Mathéo Auer edited this page Oct 20, 2025 · 1 revision

Core Concepts: EffectClips, Layers, and Bindings

An EffectClip is the central component that brings a Timeline (the "what to animate") and an Effect (the "how to render") together. It's the primary Playable unit that you give to the AnimationEngine.

EffectClip

An EffectClip is created using its builder and configures three main things:

  1. The Timeline: Which timeline will drive this animation.
  2. The Layers: One or more visual effect layers.
  3. The Bindings: How the timeline's properties connect to the layers.

Layers for Composite Effects

An EffectClip can have multiple layers. This is extremely useful for creating complex effects that share the same master timeline. For example, a spell effect could have:

  • A main expanding sphere on one layer.
  • Swirling particles on a second layer.
  • A ground-crack decal on a third layer.

All these layers will be perfectly synchronized because they are driven by the same timeline playback instance.

EffectClip complexSpell = EffectClip.builder()
    .timeline(myTimeline)
    // Layer 1: The main sphere
    .layer(layer -> layer.effect(new SphereEffect(...)))
    // Layer 2: Swirling particles
    .layer(layer -> layer.effect(new SwirlEffect(...)))
    .build();

Bindings: The Glue Between Timeline and Effect

The .bindings() method is where you connect the TimelineProperty values from your timeline to the @AnimatedProperty fields of your Effect.

  • bindParameter("fieldName", timelineProperty): This is the most common binding. It takes the value from timelineProperty and injects it into the field named "fieldName" on your AnimatedEffect instance.

Bindings can be applied at the root level (.rootBindings()) to affect all layers, or at the layer level to be specific to that layer.

◄ Back to Core Concepts

Clone this wiki locally