Cocos AIR animation and tween contracts
Stop once you can answer the task. Do not read another same-topic reference for the same question.
Scope: Tween chains, code-built clips and deterministic single-clock stepping.
Environment: use package imports in apps; source paths require an AIR checkout. See context.
Quick Start
For complete setup and teardown, read Quick Start.
Siblings: direct dependencies; reuse loaded skills.
Triggers
- Move, scale or rotate over time
- Run simultaneous motions or repeating sequences
- Build or loop a keyed animation clip
- Per-frame logic with delta time
- Advance deterministic frames for evidence
- Check state-machine or pose-graph availability
Exact API and symptom mappings: triggers.
Contracts
Use one clock for native updates and deterministic steps. Preserve tween target ownership; pose-graph availability requires checking the actual entry. WrapMode is accessed through AnimationClip.WrapMode.
Read references/contracts.md only when the task needs exact option rules, limits, error behavior or source annotations. Prefer the topic references below for a narrower question.
Common Mistakes
- [HIGH] Track classes live under the animation namespace.
- [HIGH] Never run the real pacer with the step clock.
- [HIGH] Embedded reverseTime has a documented endpoint defect.
- [MEDIUM] Reassigning wrapMode resets playback; pose graphs are unpublished.
Read relevant wrong/right examples before implementation.
Reference map
- Per-frame geometry? - Component.update(dt)
- Build or loop clips? - Tracks and wrap modes
- Compose motions? - Chains, ownership and defects
- Deterministic frames? - One clock and proof limits