.achx is the XML serialization of an AnimationChainListSave. It describes texture-flip animations: a list of chains, each a list of frames, each frame naming a texture + UV/pixel coordinates + timing (and, more recently, optional per-frame color). See the AnimationChainList file docs and the runtime API.
The save ↔ runtime split (the core thing to internalize)
There are two parallel class trees — a serialized "Save" tree and a runtime tree — and you convert between them. Don't confuse the two.
Load:AnimationChainListSave.FromFile(fileName) → ToAnimationChainList(...) → per chain ToAnimationChain(...) → per frame AnimationFrameSave.ToAnimationFrame(...).
Save: the AnimationFrameSave(AnimationFrame template) ctor copies runtime → save.
Apply to a Sprite: runtime frames are pushed onto a Sprite in Sprite.UpdateToAnimationFrame (called from UpdateToCurrentAnimationFrame / AnimateSelf). That method is the single hook where per-frame texture/coords/flip/color land on the Sprite.
Landmines
Two deserialization paths, kept in sync by hand. Desktop uses reflection-based FileManager.XmlDeserialize<AnimationChainListSave>. Android/iOS use a hand-written manual path (AnimationChainListSave.DeserializeManually / LoadFromElement, and AnimationFrameSave.FromXElement — a switch on element local-name). Any new serialized element must be added to BOTH, or it loads on desktop and silently vanishes on mobile.
ShouldSerializeXxx() controls XML output. Save-class fields use ShouldSerializeXxx() methods so defaults/nulls are omitted from the .achx. New optional fields follow this pattern to stay backward-compatible (old files just lack the element).
Coordinate + time units differ from runtime.AnimationChainListSave.CoordinateType is UV or Pixel — ToAnimationFrame converts Pixel→UV by dividing by texture width/height. TimeMeasurementUnit (seconds vs. milliseconds) makes ToAnimationChain divide FrameLength by 1000. The runtime is always UV + seconds.
Per-frame color (signpost)
Frames carry optional nullable tint: Red/Green/Blue/Alpha and a color operation. The .achx/Save side stores 0–255 ints and an editor-flavored op enum; the runtime side stores 0–1 floats and FlatRedBall.Graphics.ColorOperation, with mapping done in AnimationFrameSave.ToAnimationFrame. Applied to the Sprite in Sprite.UpdateToAnimationFrame (ApplyAnimationFrameColor). Read the source there for the exact channels, identity-on-null rules, and op mapping.
one frame; ToAnimationFrame, FromXElement, color map
Graphics/Animation/AnimationFrame.cs
runtime frame
Sprite.cs
UpdateToAnimationFrame — where a frame is applied to a Sprite
1---2name: achx-format3description: .achx Animation File Format4---56# .achx Animation File Format78`.achx` is the XML serialization of an `AnimationChainListSave`. It describes texture-flip animations: a list of chains, each a list of frames, each frame naming a texture + UV/pixel coordinates + timing (and, more recently, optional per-frame color). See the [AnimationChainList file docs](https://docs.flatredball.com/flatredball/glue-reference/files/file-types/glue-reference-animationchainlist) and the [runtime API](https://docs.flatredball.com/flatredball/api/flatredball/graphics/animation/flatredball-graphics-animationchainlist).910## The save ↔ runtime split (the core thing to internalize)1112There are **two parallel class trees** — a serialized "Save" tree and a runtime tree — and you convert between them. Don't confuse the two.1314| Save (`.achx`, `Content/AnimationChain/`) | Runtime (`Graphics/Animation/`) |15|---|---|16| `AnimationChainListSave` (`[XmlType("AnimationChainArraySave")]`) | `AnimationChainList` |17| `AnimationChainSave` (`[XmlRoot("AnimationChain")]`) | `AnimationChain` |18| `AnimationFrameSave` | `AnimationFrame` |1920- **Load:** `AnimationChainListSave.FromFile(fileName)` → `ToAnimationChainList(...)` → per chain `ToAnimationChain(...)` → per frame `AnimationFrameSave.ToAnimationFrame(...)`.21- **Save:** the `AnimationFrameSave(AnimationFrame template)` ctor copies runtime → save.22- **Apply to a Sprite:** runtime frames are pushed onto a `Sprite` in `Sprite.UpdateToAnimationFrame` (called from `UpdateToCurrentAnimationFrame` / `AnimateSelf`). That method is the single hook where per-frame texture/coords/flip/color land on the Sprite.2324## Landmines2526- **Two deserialization paths, kept in sync by hand.** Desktop uses reflection-based `FileManager.XmlDeserialize<AnimationChainListSave>`. Android/iOS use a hand-written manual path (`AnimationChainListSave.DeserializeManually` / `LoadFromElement`, and `AnimationFrameSave.FromXElement` — a `switch` on element local-name). **Any new serialized element must be added to BOTH**, or it loads on desktop and silently vanishes on mobile.27- **`ShouldSerializeXxx()` controls XML output.** Save-class fields use `ShouldSerializeXxx()` methods so defaults/nulls are omitted from the `.achx`. New optional fields follow this pattern to stay backward-compatible (old files just lack the element).28- **Coordinate + time units differ from runtime.** `AnimationChainListSave.CoordinateType` is UV *or* Pixel — `ToAnimationFrame` converts Pixel→UV by dividing by texture width/height. `TimeMeasurementUnit` (seconds vs. milliseconds) makes `ToAnimationChain` divide `FrameLength` by 1000. The runtime is always UV + seconds.2930## Per-frame color (signpost)3132Frames carry optional nullable tint: `Red/Green/Blue/Alpha` and a color operation. The `.achx`/Save side stores 0–255 ints and an editor-flavored op enum; the runtime side stores 0–1 floats and `FlatRedBall.Graphics.ColorOperation`, with mapping done in `AnimationFrameSave.ToAnimationFrame`. Applied to the Sprite in `Sprite.UpdateToAnimationFrame` (`ApplyAnimationFrameColor`). Read the source there for the exact channels, identity-on-null rules, and op mapping.3334## Key files3536| File (`Engines/FlatRedBallXNA/FlatRedBall/`) | Purpose |37|---|---|38| `Content/AnimationChain/AnimationChainListSave.cs` | `.achx` root; `FromFile`, `ToAnimationChainList`, manual load |39| `Content/AnimationChain/AnimationChainSave.cs` | one chain; `ToAnimationChain`, `FromXElement` |40| `Content/AnimationChain/AnimationFrameSave.cs` | one frame; `ToAnimationFrame`, `FromXElement`, color map |41| `Graphics/Animation/AnimationFrame.cs` | runtime frame |42| `Sprite.cs` | `UpdateToAnimationFrame` — where a frame is applied to a Sprite |
Run npx skillmds@latest add vchelaru/achx-format in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
.achx Animation File Format It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
vchelaru (@vchelaru) published this skill. Their other Agent Skills are listed on their SkillMD profile.