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

/cocosair-scene-graph

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Build Scene/Node hierarchies, Component lifecycles, layers and events. Use for reparenting, active inheritance, NodePool reuse, scene globals or resource release.

  • 10 files
  • 85.5 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-scene-graph

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencesquick-start.md

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

Derived from the cocosair-scene-graph 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.

Environment: the HTML examples using /build/ require the AIR development server and an existing bundle. In npm applications use the installed package name and the application's own bundler/server; resolve docs and declarations from that package. Do not copy repository URLs into a consumer app. Browser behavior is verified only for explicitly tested snippets and candidates.

Quick Start

<canvas id="GameCanvas"></canvas>
<script type="importmap">
  { "imports": { "cocosair": "/build/cocosair.module.js" } }
</script>
<script type="module">
import { createAirApp, Scene, Node, Component, Layers, Vec3 } from 'cocosair'; // page alias, not the package name

const app = await createAirApp({ canvas: '#GameCanvas' }); // canvas must exist before this import

const scene = new Scene('Main');          // Scene extends Node: attach children to it directly
const root = new Node('Root');
root.layer = Layers.Enum.DEFAULT;         // 3D culling needs camera.visibility to CONTAIN node.layer; the default camera mask already includes DEFAULT
root.setPosition(new Vec3(0, 1, 0));      // local coords, relative to the parent
scene.addChild(root);                     // returns void; no chaining

class Spinner extends Component {
    update (dt) {                         // dt is in SECONDS, not milliseconds
        this.node.setRotationFromEuler(0, this.node.eulerAngles.y + dt * 30, 0);
    }
}
root.addComponent(Spinner);               // onLoad -> onEnable -> start -> update -> lateUpdate
app.run(scene);                            // running a new scene destroys the previous one
</script>

Entry choice, importmap alias and install are owned by cocosair-project-setup; createAirApp options and the run/release/close handle by cocosair-application.

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
[
  "attach or reparent nodes in a scene",
  "understand component lifecycle and update order",
  "a child is inactive or inherits unexpected scale",
  "manage node events, layers or object pools",
  "release scenes and external listeners without leaking"
]
owns
[
  "scene-hierarchy",
  "component-lifecycle",
  "node-events",
  "layers",
  "node-pool",
  "scene-globals"
]
not_for
[
  "native input and action mapping -> cocosair-input-action",
  "app-level scene replacement -> cocosair-application",
  "camera framing and projection -> cocosair-camera"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "使用原生 Scene、Node、Component 构建场景树并管理层、事件、生命周期和资源释放。用于节点组织、组件更新、对象池或场景配置。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-scene-graph