Cocos AIR asset contracts
Stop once you can answer the task. Do not read another same-topic reference for the same question.
Scope: Registry/URL loading, AssetBank ownership, textures, libGDX atlases and BMFont.
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
- Load runtime JSON, registry assets or remote URLs
- Resources bundle is null or loading exports are missing
- Build or refill textures from pixels
- Parse sprite sheets or bind bitmap fonts
- Reload returns a destroyed cached asset
- Atlas or font refuses to dispose
- Abort a subscriber or inspect browser evidence
Exact API and symptom mappings: triggers.
Contracts
AIR has no implicit Creator resources bundle. Keep ImageAsset/Texture2D and cache/refcount ownership distinct; detach users before disposing handles. Abort cancels a subscriber, not the shared underlying request.
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] No implicit resources bundle or Creator build output.
- [HIGH] AbortSignal does not cancel the shared network request.
- [HIGH] Label supports the documented bitmap-font path.
- [MEDIUM] Check extension hints and trimmed-atlas URL handling.
Read relevant wrong/right examples before implementation.
Reference map
- Load or release assets? - Cache, refs and errors
- Upload pixels? - CPU/GPU data and formats
- Parse sprite sheets? - Top-origin rects and ownership
- Bind a bitmap font? - Single-page font lifecycle