Working context
Use package imports and shipped docs for an application; use source paths and repository commands only in a confirmed AIR checkout. A copied host skill is not a runtime installation.
Read the shared environment rules when locating these roots. If sibling resources are unavailable, use the installed canonical chapter and disclose the limitation. Tool declarations identify workflow capabilities; they do not authorize installation, writes, publication or any action outside the user and host scope.
Related skills
- cocosair - routing and shared Code First constraints; reuse it if already loaded.
- cocosair-project-setup - which entry exposes a name and how
AIR_FEATURESvariants are built; this skill reads the default bundle face only. - cocosair-application -
createAirAppboot order and the#GameCanvasimport contract; asset manager initialization comes from there, not from this skill. - cocosair-scene-graph - the deferred
destroy()andisValidrules this skill's asset release ordering depends on. - cocosair-materials-effects - sampling a
Texture2Dfrom a material (USE_TEXTURE,setPropertytype matching); this skill owns producing and releasing the texture. - cocosair-primitives-mesh -
utils.createMeshresults are assets you register and release the same way. - cocosair-gltf -
GLTFLoader/GLTFAssetand decoder injection;loadAssetAsyncroutes.gltf/.glbthere and stops being the generic path. - cocosair-ui-2d -
SpriteandLabelconsumption ofSpriteFrameandBitmapFont; this skill owns the loading and refcount side. - cocosair-performance -
dynamicAtlasManagerre-copying atlas and sprite frames, and texture identity in 2D batch keys. - cocosair-graphics-and-dom - canvas and DOM image sources for textures, and
AirUIMeshtexture leases. - cocosair-verification - the gates and collectors behind every browser claim quoted below.
Original entry guidance
The original entry wording below is an on-demand archive, not a second routing source.
Use the environment rules to locate the checkout or installed package; sibling skills are optional direct dependencies, not a recursive load list.
Load assets through the Code First registry and the reference-counted bank, build textures from canvas and pixel data, and parse libGDX atlases and BMFont pages - there is no Creator bundle pipeline here, so every bundle-era snippet needs re-grounding.
Read references/quick-start.md when constructing the minimal example. It preserves the complete setup and teardown sequence; select the source-checkout or npm-consumer environment first.
Read references/context.md to select the owner of this step and only its directly needed dependencies. Reuse already loaded skills; this is not a recursive load list.
Original mistake navigation
Before implementing the relevant path, read its wrong/right examples in references/common-mistakes.md:
- [HIGH] Assuming a resources bundle or Creator build output
- [HIGH] Treating an AbortSignal as a network cancel
- [HIGH] Copying the manual line that Label can only use system fonts
- [MEDIUM] Suffix-less or trimmed-atlas URLs
Original metadata
Description and description_en
The two original fields contained exactly the same value, retained once here.
Drives the Cocos AIR asset surface - the Code First loading route (assetManager.assets registry plus loadAssetAsync and its gltf, resources, registry, then URL deserialize order), the reference-counted AssetBank over assetManager.loadRemote with the ext and cache-key rules, the subscriber-side-only signal and the full AIR_E_* throw map, the two-object texture model where ImageAsset carries CPU pixels and Texture2D samples them through reset, uploadData, updateMipmaps and the wrap and filter setters, parseAtlasText and createAtlasHandle for libGDX TexturePacker text atlases with top-left rect.y semantics, and parseFnt, createBitmapFont and loadBitmapFont for single-page BMFont. Use when assetManager.resources is null, when load or loadRemote is not an importable name, when reloading the same URL hands back a destroyed asset, when an atlas or font handle refuses to dispose, or when a label still renders with a system font.
Keywords
Cocos AIR, cocosair.js, assets
References
- asset-bank.md - the
AssetBankpublic surface, everyAIR_E_*throw site, cache-key andextrules, subscriber-sidesignal, microtask cache hits, two-phase progress,releaseAllrevoke ordering, theloadAssetAsyncfallback chain, default bundle face, browser status. - texture2d.md -
ImageAssetandTexture2Dconstruction and reset paths,uploadDataand mipmap generation, wrap/filter/anisotropy setters and serialized defaults, enum inventories, format legality andmaxTextureSizebehavior, lifecycle helpers, which members only reachno-runtime-error. - atlas.md -
parseAtlasTextdialects and key sets, theAirAtlasDocumentshape, top-originrect.yruling and rotation, throw versus silent handling,createAtlasHandleownership and the in-use guard,loadAtlaspipeline and abort semantics, tracked versus regenerable evidence. - bmfont.md -
parseFntaccepted records and every guard, the single-page constraint,createBitmapFontpage validation and handle refs,Labelselection and sizing and kerning key math,loadBitmapFontsteps and error surface, the stale manual statement.
Canonical docs
docs/guides/asset-loading.md- open for the twoloadAssetAsyncoverloads and the registry example; note it predates the glTF branch, so read its resolution order as incomplete.docs/manual/asset-loading-and-lifetime.md- open for the three entry points with their measured rejection messages and the five lifetime semantics the manual example asserts line by line.docs/manual/asset-bank-loading.md- open for theAssetBankcontract page and its own statement of what jsdom evidence does not prove.docs/manual/atlas-loading.md- open for the top-origin ruling, the trim formula, the page-size guard, the no-automatic-addRefrule and the PNG-only auto path.docs/manual/bitmap-font-loading.md- open for the single-page rule, theLabelbinding contract, the scale reuse behavior and the error inventory.docs/manual/textures.md- open for the texture narrative and the format table; treat its default-wrap sentence as stale againstsrc/cocos/asset/assets/texture-base.ts:122.