Index of every page on this site: llms.txt
All skills
oahc09 avatar

/cocosair-2d-subsystems

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Build DragonBones, TiledMap, 2D/3D particles and billboards from runtime data. Use for raw asset strings, missing pixels, MotionStreak or Spine backend limits.

  • 12 files
  • 56.9 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-2d-subsystems

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescontracts.md

≈876 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Derived from the cocosair-2d-subsystems skill and its canonical docs/source pointers; reorganized on 2026-10-11. Source annotations below identify repository inputs, not files guaranteed to ship to npm consumers.

Contracts

  • The bundle export line is the whole public face. The single export { ... } block of build/cocosair.module.js (currently :161574) is the only name list; MotionStreak2D is absent from src/ entirely, the class is cc.MotionStreak (src/cocos/particle-2d/motion-streak-2d.ts:68, :73) re-exported as MotionStreak (src/cocos/particle-2d/index.ts:31-37). Full symbol list in each reference file.
  • Spine is BLOCKED at the backend and asset layer, not the API layer: src/exports/spine.ts:3 and :5 give sp plus loadWasmModuleSpine, but the shim installs warn-and-return-null stubs over spine.wasmUtil (src/cocos/spine/lib/air-spine-instantiate-js.ts:26-52), so SkeletonData.getRuntimeData() returns null (src/cocos/spine/skeleton-data.ts:199-237) and Skeleton._updateSkeletonData() bails silently at src/cocos/spine/skeleton.ts:791. Awaiting loadWasmModuleSpine proves nothing (src/cocos/spine/index.ts:127-136). See spine.md.
  • DragonBones is runnable and needs three objects plus one key: atlas asset atlasJson parses text (src/cocos/dragon-bones/DragonBonesAtlasAsset.ts:53-59) and texture wants a Texture2D (:86-90); skeleton via dragonBonesJson text (src/cocos/dragon-bones/DragonBonesAsset.ts:58); asset.init(factory, atlasUuid) returns the armature key (:99-128). armature is a METHOD (src/cocos/dragon-bones/ArmatureDisplay.ts:1469), playAnimation(name, 0) is play-once so loop needs -1 (:1269), and premultipliedAlpha defaults to false (:412). See dragonbones.md.
  • TiledMap builds its whole map from a TiledMapAsset bag of parallel arrays handed to TMXMapInfo (src/cocos/tiledmap/tiled-map.ts:340-388). A runtime cell edit via setTileGIDAt(gid, x, y, flags) (src/cocos/tiledmap/tiled-layer.ts:693-711) sets only _cullingDirty (:714-731) which is not render-data dirty, so refresh needs markForUpdateRenderData() (src/cocos/2d/framework/ui-renderer.ts:431-433) or node reactivation (examples/tiledmap-basic/main.js:396-405). Object queries read class, geometry reads the shape enum (src/cocos/tiledmap/tiled-object-group.ts:179). See tiledmap.md.
  • ParticleSystem2D reads the plist, not your assignments: parsePlist (src/cocos/asset/asset-manager/parser.ts:63) -> asset._nativeAsset -> custom = false + file fires _initWithDictionary (src/cocos/particle-2d/particle-system-2d.ts:922-948). The lifespan key is particleLifespan (:1047) and blendFuncSource/blendFuncDestination land in gfx BlendFactor slots capped at 14 (:1062-1063, src/cocos/gfx/base/define.ts:505-521), so Creator's 770 and 1 draw nothing. See particle-2d.md.
  • Billboard is a scene.Model with a four-vertex quad (src/cocos/particle/billboard.ts:243-276) re-exported from src/air/index.ts:30, needing a 3D camera visibility not the UI one. width and height default to 0 (:65, :88) and travel with rotation through one cc_size_rotation Vec4 (:190), so node scale is ignored and an unsized billboard is invisible; the effect has one technique so technique clamps to 0 (:137-155) and onDestroy drops but never destroys the app-owned texture (:214-226). See billboard.md.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at ed38648. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
layer
subsystem
All 1 allowed tools
Read Edit Write Bash
Other metadata
compatibility
Cocos AIR source checkout or installed cocosair.js package. Browser rendering requires WebGL 2; source tooling requires Node.js >=18. Use the host-provided tools and user-authorized workspace.
when_to_use
[
  "build DragonBones assets from raw JSON strings",
  "TiledMap edits do not redraw or resolve objects",
  "particles compute but render no pixels; createAirParticleSystem 3D emitters/trails CPU/GPU",
  "Spine skeleton stays blank without an error",
  "billboard or motion trail is invisible"
]
owns
[
  "dragonbones",
  "tiledmap",
  "particle-2d",
  "billboard",
  "motion-streak",
  "spine-limits"
]
not_for
[
  "basic UI layout and controls -> cocosair-ui-2d",
  "3D skeleton deformation -> cocosair-skinning-morph",
  "remote asset caching -> cocosair-assets"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "配置 Spine、DragonBones、TiledMap、二维粒子和 Billboard 的原生运行时契约。用于资源构造、空白画面或子系统能力边界问题。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-2d-subsystems