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

/cocosair-graphics-and-dom

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Draw Graphics/SVG shapes and sprite masks; align a DOM overlay with UI/canvas nodes. Use for overlay placement, input interception, experimental HTML textures or AirUIMesh.

  • 15 files
  • 61.1 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-graphics-and-dom

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencestriggers.md

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

Cocos AIR graphics and DOM triggers

Source annotations refer to the AIR checkout.

When to use what

  • "draw a shape in code" -> build AirGraphicsCommand[], replay solid fills with drawAirGraphics on a Graphics component (src/air/graphics-commands.ts:74-88).
  • "export vector art" -> airGraphicsCommandsToSvg(commands, bounds); it keeps the original curves, the Graphics mesh does not (src/air/graphics-commands.ts:92-157).
  • "gradient, radial, pattern or evenodd hole" -> rasterizeAirGraphics(commands, options) for a Canvas2D Texture2D, then display it (src/air/graphics-raster.ts:11-85).
  • "show a texture in UI" -> createAirTextureSprite(parent, texture, options); the texture stays borrowed (src/air/texture-sprite.ts:15-48).
  • "cut one Sprite by another texture" -> attachAirSpriteMask(sprite, maskTexture, options) (src/air/effects/sprite-mask.ts:18-83).
  • "make a subtree add/multiply" -> createAirUIBlendScope(root, mode) (src/air/ui-blend.ts:11-55).
  • "keep a DOM input glued to a UI node" -> createAirDOMOverlay({ canvas }) then .attach(...) (src/air/dom-overlay.ts:24-83).
  • "warp a textured UI quad by hand" -> add the AirUIMesh component and setGeometry(...) (src/air/ui-mesh.ts:83-118).
  • "paint a live form as a GPU texture" -> the experimental HTML helpers exported by cocosair.js (see html-source.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
[
  "draw shapes or export curves as SVG",
  "paint gradients, patterns or evenodd holes",
  "mask a sprite or inherit subtree blending",
  "keep a DOM input attached to a UI node",
  "display live HTML or warp textured UI geometry"
]
owns
[
  "graphics-svg",
  "rich-fills",
  "sprite-masks",
  "ui-blend",
  "dom-overlay",
  "html-texture"
]
not_for
[
  "UI widgets and layout -> cocosair-ui-2d",
  "keyboard focus and action routing -> cocosair-input-action",
  "general offscreen render targets -> cocosair-rendering"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "使用 Graphics、SVG、栅格填充、纹理显示、遮罩、混合和 DOM 覆盖层。用于绘图导出、富填充或实验性 HTML 纹理。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-graphics-and-dom