[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E669ENKB43YP7XB8WF1R9C":3,"skill-same:01M7E669ENKB43YP7XB8WF1R9C":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7E669ENKB43YP7XB8WF1R9C","pixijs-scene-container",null,"Use this skill when grouping, positioning, or transforming display objects in PixiJS v8. Covers Container constructor options (isRenderGroup, sortableChildren, boundsArea), addChild\u002FremoveChild\u002FaddChildAt\u002FswapChildren\u002FsetChildIndex, position\u002Fscale\u002Frotation\u002Fpivot\u002Fskew\u002Falpha\u002Ftint, getBounds\u002FgetGlobalPosition\u002FtoLocal\u002FtoGlobal, zIndex sorting, cullable, onRender per-frame callback, destroy. Triggers on (in PixiJS code): Container, addChild, removeChild, addChildAt, swapChildren, sortableChildren, zIndex, container position\u002Fscale\u002Frotation\u002Fpivot, getBounds, toGlobal, toLocal, onRender, container.destroy, ContainerOptions, RenderLayer, render groups, masks.","w0rxbend\u002Fdot-agents","w0rxbend","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F8176996?v=4","01M7E4XY3Y871Z2NFBXF3H3T8F","Oleksandr B.","01M7E4XY51E6NSG05FXR36H9RV",0,"MIT","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fpixi\u002Fpixijs-scene-container\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fpixi\u002Fpixijs-scene-container\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: pixijs-scene-container\ndescription: \"Use this skill when grouping, positioning, or transforming display objects in PixiJS v8. Covers Container constructor options (isRenderGroup, sortableChildren, boundsArea), addChild\u002FremoveChild\u002FaddChildAt\u002FswapChildren\u002FsetChildIndex, position\u002Fscale\u002Frotation\u002Fpivot\u002Fskew\u002Falpha\u002Ftint, getBounds\u002FgetGlobalPosition\u002FtoLocal\u002FtoGlobal, zIndex sorting, cullable, onRender per-frame callback, destroy. Triggers on (in PixiJS code): Container, addChild, removeChild, addChildAt, swapChildren, sortableChildren, zIndex, container position\u002Fscale\u002Frotation\u002Fpivot, getBounds, toGlobal, toLocal, onRender, container.destroy, ContainerOptions, RenderLayer, render groups, masks.\"\nlicense: MIT\n---\n\n`Container`: general-purpose PixiJS v8 scene-graph node. Holds children; applies transforms, alpha, tint, blend mode to whole subtree. Every display object is a `Container` (branch) or a leaf (`Sprite`, `Graphics`, `Text`, `Mesh`) nested in one.\n\nAssumes scene graph basics in [references\u002Fscene-core-concepts.md](references\u002Fscene-core-concepts.md) (leaves vs containers, constructor options, render groups, RenderLayer, masking, culling).\n\n## Quick Start\n\n```ts\nconst group = new Container({\n  label: \"hero-group\",\n  x: 200,\n  y: 150,\n  sortableChildren: true,\n});\n\nconst body = new Sprite(await Assets.load(\"body.png\"));\nconst head = new Sprite(await Assets.load(\"head.png\"));\nhead.position.set(0, -40);\nhead.zIndex = 1;\n\ngroup.addChild(body, head);\ngroup.pivot.set(group.width \u002F 2, group.height \u002F 2);\ngroup.scale.set(1.5);\n\napp.stage.addChild(group);\n```\n\n**Related skills:** `pixijs-scene-graphics` \u002F `pixijs-scene-text` (leaves inside containers), `pixijs-events` (`eventMode`, hit testing), `pixijs-performance` (`cacheAsTexture`, culling, render groups).\n\n## Core Patterns\n\n### Constructor options\n\n```ts\nconst container = new Container({\n  label: \"world\",\n  x: 100,\n  y: 50,\n  scale: 2,\n  rotation: Math.PI \u002F 4,\n  alpha: 0.8,\n  visible: true,\n  tint: 0xffaa00,\n  blendMode: \"add\",\n  sortableChildren: true,\n  isRenderGroup: true,\n  origin: { x: 0, y: 0 },\n  boundsArea: new Rectangle(0, 0, 1920, 1080),\n});\n```\n\nConstructor bulk-copies every options field onto instance via `assignWithIgnore`, except `children`, `parent`, `effects`. So any public `Container` property works: `cullable`, `cullArea`, `mask`, `filterArea`, `eventMode`, `hitArea`, etc. Full list: constructor-options table in [references\u002Fscene-core-concepts.md](references\u002Fscene-core-concepts.md).\n\n`isRenderGroup: true` makes container own render group: transforms apply on GPU, not recomputed per-child on CPU. Use on stable sub-trees (large static worlds, UI layers). Do not overuse; most scenes need no explicit render groups, too many hurt performance. Profile first. See [references\u002Fscene-core-concepts.md](references\u002Fscene-core-concepts.md#render-groups).\n\n`origin` (v8 `ObservablePoint`) sets rotation\u002Fscale center **without** moving container. `pivot` shifts projection of local origin in parent space, so changing it displaces object; `origin` leaves position alone. Accepts `PointData` or single number (both axes); set live via `container.origin.set(x, y)`.\n\n`boundsArea` makes `getBounds()` return fixed rectangle instead of recursively measuring children. Performance win for containers with hundreds of cheap, predictable children.\n\n### Leaves vs containers\n\nOnly `Container` (and child-holding subclasses like `RenderLayer`) should have children. `Sprite`, `Graphics`, `Text`, `Mesh`, `ParticleContainer` particles, `DOMContainer` content are leaves by convention in PixiJS v8. To group, wrap in a `Container`: container owns layout logic, leaves stay pure visual data.\n\n### Adding and removing children\n\n```ts\nconst parent = new Container();\n\nparent.addChild(a, b, c);\nparent.addChildAt(d, 0);\nparent.swapChildren(a, b);\nparent.setChildIndex(c, 0);\n\nparent.removeChild(b);\nparent.removeChildAt(0);\nparent.removeChildren();\n\nparent.removeChildren(0, 2);\n```\n\n`addChild` takes any number of children, returns first. Children render in array order: index 0 first (behind), last index last (in front). `addChildAt` inserts at index; `setChildIndex` moves existing child; `swapChildren` swaps two children.\n\n`removeChildren(beginIndex?, endIndex?)` removes slice, returns removed array.\n\n`addChildAt` on child already in this container silently moves it to new index. No `added` \u002F `childAdded` \u002F `removed` \u002F `childRemoved` events fire (parent unchanged). Events fire only when child comes from different parent (or none).\n\nReparent keeping world transform (no visual jump): `reparentChild` \u002F `reparentChildAt`. Swap child in place, copying old child's local transform: `replaceChild`.\n\n### Transform properties\n\n```ts\nconst obj = new Container();\n\nobj.x = 100;\nobj.y = 200;\nobj.position.set(100, 200);\n\nobj.scale.set(2);\nobj.scale = 2;\n\nobj.rotation = Math.PI \u002F 4;\nobj.angle = 45;\n\nobj.pivot.set(50, 50);\nobj.skew.set(0.1, 0.2);\n\nobj.alpha = 0.5;\nobj.tint = 0xff0000;\nobj.visible = false;\nobj.renderable = false;\n```\n\n- `position`, `scale`, `pivot`, `skew` are `ObservablePoint`s. `scale = 2` valid; sets both axes.\n- `rotation` (radians) and `angle` (degrees) are synced aliases.\n- `pivot`: local point mapped to `position` in parent space. Changing it both moves and rotates container.\n- `alpha` and `tint` multiply down through children. `blendMode` applies to this container's draw instructions.\n- `visible = false` skips rendering and transform updates. `renderable = false` skips rendering but still updates transforms (for `getBounds()` or hit-testing without drawing).\n\n### zIndex and sortableChildren\n\n```ts\nconst world = new Container({ sortableChildren: true });\n\nconst ground = new Sprite(groundTexture);\nground.zIndex = 0;\n\nconst player = new Sprite(playerTexture);\nplayer.zIndex = 10;\n\nconst ui = new Sprite(uiTexture);\nui.zIndex = 100;\n\nworld.addChild(ground, player, ui);\n```\n\nWith `sortableChildren` `true`, container re-sorts children by `zIndex` before next render; changing any child's `zIndex` automatically marks parent as needing sort. Sort only what needs it; `sortableChildren` off is cheaper. Full manual control: call `container.sortChildren()` after changing `zIndex` values.\n\nTo render at different z while keeping logical parent for transforms, use `RenderLayer`. See [references\u002Fscene-core-concepts.md](references\u002Fscene-core-concepts.md#renderlayer-render-order-independent-of-the-hierarchy).\n\n### Bounds and coordinate conversion\n\n```ts\nconst bounds = container.getBounds();\nconsole.log(bounds.x, bounds.y, bounds.width, bounds.height);\n\nconst rect = container.getBounds().rectangle;\n\nconst local = new Point(10, 20);\nconst world = container.toGlobal(local);\nconst backToLocal = container.toLocal(world);\n\nconst selfPos = container.getGlobalPosition();\n```\n\nSignature `getBounds(skipUpdate?: boolean, bounds?: Bounds)`: first arg `true` skips forced transform update; optional second-arg `Bounds` is reused instead of allocating.\n\n`toGlobal(point)` converts point from this container's local space to scene-root space. `toLocal(point, from?)` converts from another container's local space (global if `from` omitted). `getGlobalPosition()`: shorthand for `parent.toGlobal(this._position)`.\n\n### Sizing\n\n```ts\nconst sprite = new Sprite(texture);\n\nsprite.setSize(200, 100);\nconst { width, height } = sprite.getSize();\n```\n\n`setSize` adjusts `scale` in one operation so bounds fit requested pixel size. Separate `.width` and `.height` assignments work but each recomputes bounds; prefer `setSize` for both axes.\n\n### Container events\n\n```ts\nconst parent = new Container();\n\nparent.on(\"childAdded\", (child, container, index) => {\n  console.log(\"added at\", index, child.label);\n});\n\nparent.on(\"childRemoved\", (child, container, index) => {\n  console.log(\"removed from\", index);\n});\n\nconst child = new Container();\nchild.on(\"added\", (newParent) => console.log(\"entered\", newParent.label));\nchild.on(\"removed\", (oldParent) => console.log(\"left\", oldParent.label));\nchild.on(\"visibleChanged\", (visible) => console.log(\"visible:\", visible));\nchild.on(\"destroyed\", (destroyed) => console.log(\"gone\", destroyed.label));\n\nparent.addChild(child);\n```\n\n| Event            | Fires on                          | Arguments                   |\n| ---------------- | --------------------------------- | --------------------------- |\n| `childAdded`     | parent receiving child            | `(child, container, index)` |\n| `childRemoved`   | parent losing child               | `(child, container, index)` |\n| `added`          | attached child                    | `(parent)`                  |\n| `removed`        | detached child                    | `(parent)`                  |\n| `destroyed`      | destroyed container               | `(container)`               |\n| `visibleChanged` | container whose `visible` flipped | `(visible)`                 |\n\nThese are `Container`'s `EventEmitter` events, not pointer events from `pixijs-events`.\n\n`destroyed` fires after internal cleanup, before listener removal. In handler, `position`, `scale`, `pivot`, `origin`, `skew`, `parent` already nulled; `children` emptied (length 0, array reference not nulled). Capture needed data _before_ `destroy()`, not in handler.\n\n### Per-frame updates with onRender\n\n```ts\nconst container = new Container();\n\ncontainer.onRender = (renderer) => {\n  container.rotation += 0.01;\n};\n\ncontainer.onRender = null;\n```\n\n`onRender` runs every frame while container renders; receives active `Renderer`. Use for lightweight per-container animation or updates. v7 overrode `updateTransform` instead; v8 no longer calls `updateTransform` every frame. `onRender = null` detaches.\n\n### Finding and removing from parent\n\n```ts\nconst player = world.getChildByLabel(\"player\");\nconst enemies = world.getChildrenByLabel(\u002Fenemy-\\d+\u002F, true);\n\nconst bounds = hud.getLocalBounds();\n\noldSprite.removeFromParent();\n```\n\n- `getChildByLabel(label, deep?)` — first match by string or `RegExp`. Pass `true` for recursive search.\n- `getChildrenByLabel(label, deep?, out?)` — all matches. Accepts optional reusable output array.\n- `getLocalBounds()` — bounds in container's own coordinate space, ignoring parent transforms. Cheaper than `getBounds()` for self-contained layout math.\n- `removeFromParent()` — detaches `this` from current parent (no-op if already orphaned).\n\n### Destroy\n\n```ts\ncontainer.destroy();\n\ncontainer.destroy({\n  children: true,\n  texture: true,\n  textureSource: true,\n});\n\nconsole.log(container.destroyed);\n```\n\nDefault `destroy()` unlinks from parent and tears down own state. `{ children: true }` recursively destroys every descendant (usual call for whole subtree). `texture: true` and `textureSource: true` also destroy GPU resources of leaf children (for textures loaded only for them).\n\n## Common Mistakes\n\n### [CRITICAL] Adding children to leaf scene objects\n\nWrong:\n\n```ts\nconst sprite = new Sprite(texture);\nconst overlay = new Sprite(overlayTexture);\nsprite.addChild(overlay);\n```\n\nCorrect:\n\n```ts\nconst group = new Container();\nconst sprite = new Sprite(texture);\nconst overlay = new Sprite(overlayTexture);\ngroup.addChild(sprite, overlay);\n```\n\nSprites, Graphics, Text, Mesh are leaves. Adding children to them logs deprecation warning now; will be error in future version. Always group them in a `Container`.\n\n### [HIGH] Expecting getBounds() to return a Rectangle\n\nWrong:\n\n```ts\nconst rect = container.getBounds();\nrect.contains(x, y); \u002F\u002F TypeError: contains is not a function\n```\n\nCorrect:\n\n```ts\nconst rect = container.getBounds().rectangle;\nrect.contains(x, y);\n\nconst bounds = container.getBounds();\nconsole.log(bounds.width, bounds.height);\n```\n\nv8 `getBounds()` returns `Bounds`. Basic getters (`x`, `y`, `width`, `height`) work; for `Rectangle`-specific methods like `.contains()` or APIs requiring a `Rectangle`, read `.rectangle`.\n\n### [HIGH] Using cacheAsBitmap instead of cacheAsTexture\n\nWrong:\n\n```ts\ncontainer.cacheAsBitmap = true;\n```\n\nCorrect:\n\n```ts\ncontainer.cacheAsTexture(true);\n```\n\nv8 renamed `cacheAsBitmap` (v7 property) to `cacheAsTexture()` (method). Always disable with `cacheAsTexture(false)` before calling `destroy()`.\n\n### [MEDIUM] Using container.name instead of container.label\n\nv8 renamed `name` to `label`; `name` still works as deprecated alias. Look up children by name with `getChildByLabel`.\n\n### [MEDIUM] Setting both pivot and origin on the same container\n\nPivot shifts projection of local origin in parent space (changing rotation center moves object as side-effect). Origin changes rotation\u002Fscale center without displacement. Both on one container compound unexpectedly; pick one.\n\n## API Reference\n\n- [Container](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fscene.Container.html.md)\n- [ContainerOptions](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fscene.ContainerOptions.html.md)\n- [ViewContainer](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fscene.ViewContainer.html.md)\n- [Bounds](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.Bounds.html.md)\n- [Point](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fmaths.Point.html.md)\n- [ObservablePoint](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fmaths.ObservablePoint.html.md)\n- [RenderGroup](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.RenderGroup.html.md)\n","`Container`: general-purpose PixiJS v8 scene-graph node. Holds children; applies transforms, alpha, tint, blend mode to whole subtree. Every display object is a `Container` (branch) or a leaf (`Sprite`, `Graphics`, `Text`, `Mesh`) nested in one.\n\nAssumes scene graph basics in [references\u002Fscene-core-concepts.md](references\u002Fscene-core-concepts.md) (leaves vs containers, constructor options, render groups, RenderLayer, masking, culling).\n\n## Quick Start\n\n```ts\nconst group = new Container({\n  label: \"hero-group\",\n  x: 200,\n  y: 150,\n  sortableChildren: true,\n});\n\nconst body = new Sprite(await Assets.load(\"body.png\"));\nconst head = new Sprite(await Assets.load(\"head.png\"));\nhead.position.set(0, -40);\nhead.zIndex = 1;\n\ngroup.addChild(body, head);\ngroup.pivot.set(group.width \u002F 2, group.height \u002F 2);\ngroup.scale.set(1.5);\n\napp.stage.addChild(group);\n```\n\n**Related skills:** `pixijs-scene-graphics` \u002F `pixijs-scene-text` (leaves inside containers), `pixijs-events` (`eventMode`, hit testing), `pixijs-performance` (`cacheAsTexture`, culling, render groups).\n\n## Core Patterns\n\n### Constructor options\n\n```ts\nconst container = new Container({\n  label: \"world\",\n  x: 100,\n  y: 50,\n  scale: 2,\n  rotation: Math.PI \u002F 4,\n  alpha: 0.8,\n  visible: true,\n  tint: 0xffaa00,\n  blendMode: \"add\",\n  sortableChildren: true,\n  isRenderGroup: true,\n  origin: { x: 0, y: 0 },\n  boundsArea: new Rectangle(0, 0, 1920, 1080),\n});\n```\n\nConstructor bulk-copies every options field onto instance via `assignWithIgnore`, except `children`, `parent`, `effects`. So any public `Container` property works: `cullable`, `cullArea`, `mask`, `filterArea`, `eventMode`, `hitArea`, etc. Full list: constructor-options table in [references\u002Fscene-core-concepts.md](references\u002Fscene-core-concepts.md).\n\n`isRenderGroup: true` makes container own render group: transforms apply on GPU, not recomputed per-child on CPU. Use on stable sub-trees (large static worlds, UI layers). Do not overuse; most scenes need no explicit render groups, too many hurt performance. Profile first. See [references\u002Fscene-core-concepts.md](references\u002Fscene-core-concepts.md#render-groups).\n\n`origin` (v8 `ObservablePoint`) sets rotation\u002Fscale center **without** moving container. `pivot` shifts projection of local origin in parent space, so changing it displaces object; `origin` leaves position alone. Accepts `PointData` or single number (both axes); set live via `container.origin.set(x, y)`.\n\n`boundsArea` makes `getBounds()` return fixed rectangle instead of recursively measuring children. Performance win for containers with hundreds of cheap, predictable children.\n\n### Leaves vs containers\n\nOnly `Container` (and child-holding subclasses like `RenderLayer`) should have children. `Sprite`, `Graphics`, `Text`, `Mesh`, `ParticleContainer` particles, `DOMContainer` content are leaves by convention in PixiJS v8. To group, wrap in a `Container`: container owns layout logic, leaves stay pure visual data.\n\n### Adding and removing children\n\n```ts\nconst parent = new Container();\n\nparent.addChild(a, b, c);\nparent.addChildAt(d, 0);\nparent.swapChildren(a, b);\nparent.setChildIndex(c, 0);\n\nparent.removeChild(b);\nparent.removeChildAt(0);\nparent.removeChildren();\n\nparent.removeChildren(0, 2);\n```\n\n`addChild` takes any number of children, returns first. Children render in array order: index 0 first (behind), last index last (in front). `addChildAt` inserts at index; `setChildIndex` moves existing child; `swapChildren` swaps two children.\n\n`removeChildren(beginIndex?, endIndex?)` removes slice, returns removed array.\n\n`addChildAt` on child already in this container silently moves it to new index. No `added` \u002F `childAdded` \u002F `removed` \u002F `childRemoved` events fire (parent unchanged). Events fire only when child comes from different parent (or none).\n\nReparent keeping world transform (no visual jump): `reparentChild` \u002F `reparentChildAt`. Swap child in place, copying old child's local transform: `replaceChild`.\n\n### Transform properties\n\n```ts\nconst obj = new Container();\n\nobj.x = 100;\nobj.y = 200;\nobj.position.set(100, 200);\n\nobj.scale.set(2);\nobj.scale = 2;\n\nobj.rotation = Math.PI \u002F 4;\nobj.angle = 45;\n\nobj.pivot.set(50, 50);\nobj.skew.set(0.1, 0.2);\n\nobj.alpha = 0.5;\nobj.tint = 0xff0000;\nobj.visible = false;\nobj.renderable = false;\n```\n\n- `position`, `scale`, `pivot`, `skew` are `ObservablePoint`s. `scale = 2` valid; sets both axes.\n- `rotation` (radians) and `angle` (degrees) are synced aliases.\n- `pivot`: local point mapped to `position` in parent space. Changing it both moves and rotates container.\n- `alpha` and `tint` multiply down through children. `blendMode` applies to this container's draw instructions.\n- `visible = false` skips rendering and transform updates. `renderable = false` skips rendering but still updates transforms (for `getBounds()` or hit-testing without drawing).\n\n### zIndex and sortableChildren\n\n```ts\nconst world = new Container({ sortableChildren: true });\n\nconst ground = new Sprite(groundTexture);\nground.zIndex = 0;\n\nconst player = new Sprite(playerTexture);\nplayer.zIndex = 10;\n\nconst ui = new Sprite(uiTexture);\nui.zIndex = 100;\n\nworld.addChild(ground, player, ui);\n```\n\nWith `sortableChildren` `true`, container re-sorts children by `zIndex` before next render; changing any child's `zIndex` automatically marks parent as needing sort. Sort only what needs it; `sortableChildren` off is cheaper. Full manual control: call `container.sortChildren()` after changing `zIndex` values.\n\nTo render at different z while keeping logical parent for transforms, use `RenderLayer`. See [references\u002Fscene-core-concepts.md](references\u002Fscene-core-concepts.md#renderlayer-render-order-independent-of-the-hierarchy).\n\n### Bounds and coordinate conversion\n\n```ts\nconst bounds = container.getBounds();\nconsole.log(bounds.x, bounds.y, bounds.width, bounds.height);\n\nconst rect = container.getBounds().rectangle;\n\nconst local = new Point(10, 20);\nconst world = container.toGlobal(local);\nconst backToLocal = container.toLocal(world);\n\nconst selfPos = container.getGlobalPosition();\n```\n\nSignature `getBounds(skipUpdate?: boolean, bounds?: Bounds)`: first arg `true` skips forced transform update; optional second-arg `Bounds` is reused instead of allocating.\n\n`toGlobal(point)` converts point from this container's local space to scene-root space. `toLocal(point, from?)` converts from another container's local space (global if `from` omitted). `getGlobalPosition()`: shorthand for `parent.toGlobal(this._position)`.\n\n### Sizing\n\n```ts\nconst sprite = new Sprite(texture);\n\nsprite.setSize(200, 100);\nconst { width, height } = sprite.getSize();\n```\n\n`setSize` adjusts `scale` in one operation so bounds fit requested pixel size. Separate `.width` and `.height` assignments work but each recomputes bounds; prefer `setSize` for both axes.\n\n### Container events\n\n```ts\nconst parent = new Container();\n\nparent.on(\"childAdded\", (child, container, index) => {\n  console.log(\"added at\", index, child.label);\n});\n\nparent.on(\"childRemoved\", (child, container, index) => {\n  console.log(\"removed from\", index);\n});\n\nconst child = new Container();\nchild.on(\"added\", (newParent) => console.log(\"entered\", newParent.label));\nchild.on(\"removed\", (oldParent) => console.log(\"left\", oldParent.label));\nchild.on(\"visibleChanged\", (visible) => console.log(\"visible:\", visible));\nchild.on(\"destroyed\", (destroyed) => console.log(\"gone\", destroyed.label));\n\nparent.addChild(child);\n```\n\n| Event            | Fires on                          | Arguments                   |\n| ---------------- | --------------------------------- | --------------------------- |\n| `childAdded`     | parent receiving child            | `(child, container, index)` |\n| `childRemoved`   | parent losing child               | `(child, container, index)` |\n| `added`          | attached child                    | `(parent)`                  |\n| `removed`        | detached child                    | `(parent)`                  |\n| `destroyed`      | destroyed container               | `(container)`               |\n| `visibleChanged` | container whose `visible` flipped | `(visible)`                 |\n\nThese are `Container`'s `EventEmitter` events, not pointer events from `pixijs-events`.\n\n`destroyed` fires after internal cleanup, before listener removal. In handler, `position`, `scale`, `pivot`, `origin`, `skew`, `parent` already nulled; `children` emptied (length 0, array reference not nulled). Capture needed data _before_ `destroy()`, not in handler.\n\n### Per-frame updates with onRender\n\n```ts\nconst container = new Container();\n\ncontainer.onRender = (renderer) => {\n  container.rotation += 0.01;\n};\n\ncontainer.onRender = null;\n```\n\n`onRender` runs every frame while container renders; receives active `Renderer`. Use for lightweight per-container animation or updates. v7 overrode `updateTransform` instead; v8 no longer calls `updateTransform` every frame. `onRender = null` detaches.\n\n### Finding and removing from parent\n\n```ts\nconst player = world.getChildByLabel(\"player\");\nconst enemies = world.getChildrenByLabel(\u002Fenemy-\\d+\u002F, true);\n\nconst bounds = hud.getLocalBounds();\n\noldSprite.removeFromParent();\n```\n\n- `getChildByLabel(label, deep?)` — first match by string or `RegExp`. Pass `true` for recursive search.\n- `getChildrenByLabel(label, deep?, out?)` — all matches. Accepts optional reusable output array.\n- `getLocalBounds()` — bounds in container's own coordinate space, ignoring parent transforms. Cheaper than `getBounds()` for self-contained layout math.\n- `removeFromParent()` — detaches `this` from current parent (no-op if already orphaned).\n\n### Destroy\n\n```ts\ncontainer.destroy();\n\ncontainer.destroy({\n  children: true,\n  texture: true,\n  textureSource: true,\n});\n\nconsole.log(container.destroyed);\n```\n\nDefault `destroy()` unlinks from parent and tears down own state. `{ children: true }` recursively destroys every descendant (usual call for whole subtree). `texture: true` and `textureSource: true` also destroy GPU resources of leaf children (for textures loaded only for them).\n\n## Common Mistakes\n\n### [CRITICAL] Adding children to leaf scene objects\n\nWrong:\n\n```ts\nconst sprite = new Sprite(texture);\nconst overlay = new Sprite(overlayTexture);\nsprite.addChild(overlay);\n```\n\nCorrect:\n\n```ts\nconst group = new Container();\nconst sprite = new Sprite(texture);\nconst overlay = new Sprite(overlayTexture);\ngroup.addChild(sprite, overlay);\n```\n\nSprites, Graphics, Text, Mesh are leaves. Adding children to them logs deprecation warning now; will be error in future version. Always group them in a `Container`.\n\n### [HIGH] Expecting getBounds() to return a Rectangle\n\nWrong:\n\n```ts\nconst rect = container.getBounds();\nrect.contains(x, y); \u002F\u002F TypeError: contains is not a function\n```\n\nCorrect:\n\n```ts\nconst rect = container.getBounds().rectangle;\nrect.contains(x, y);\n\nconst bounds = container.getBounds();\nconsole.log(bounds.width, bounds.height);\n```\n\nv8 `getBounds()` returns `Bounds`. Basic getters (`x`, `y`, `width`, `height`) work; for `Rectangle`-specific methods like `.contains()` or APIs requiring a `Rectangle`, read `.rectangle`.\n\n### [HIGH] Using cacheAsBitmap instead of cacheAsTexture\n\nWrong:\n\n```ts\ncontainer.cacheAsBitmap = true;\n```\n\nCorrect:\n\n```ts\ncontainer.cacheAsTexture(true);\n```\n\nv8 renamed `cacheAsBitmap` (v7 property) to `cacheAsTexture()` (method). Always disable with `cacheAsTexture(false)` before calling `destroy()`.\n\n### [MEDIUM] Using container.name instead of container.label\n\nv8 renamed `name` to `label`; `name` still works as deprecated alias. Look up children by name with `getChildByLabel`.\n\n### [MEDIUM] Setting both pivot and origin on the same container\n\nPivot shifts projection of local origin in parent space (changing rotation center moves object as side-effect). Origin changes rotation\u002Fscale center without displacement. Both on one container compound unexpectedly; pick one.\n\n## API Reference\n\n- [Container](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fscene.Container.html.md)\n- [ContainerOptions](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fscene.ContainerOptions.html.md)\n- [ViewContainer](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fscene.ViewContainer.html.md)\n- [Bounds](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.Bounds.html.md)\n- [Point](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fmaths.Point.html.md)\n- [ObservablePoint](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Fmaths.ObservablePoint.html.md)\n- [RenderGroup](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.RenderGroup.html.md)\n",{"name":5,"license":15,"description":7},"main","101d0f67250256ca5d80dc3f95767cad7b541457","skills\u002Fpixi\u002Fpixijs-scene-container","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents","https:\u002F\u002Fgithub.com\u002Fw0rxbend","https:\u002F\u002Freadme.worxbend.com\u002F","Fluent in Backend-ese (microservices, distributed systems, you know the drill)\r\nFunctional Programming Fanatic...","2026-11-14 14:44:12",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add w0rxbend\u002Fdot-agents --skill pixijs-scene-container",{"tool":39,"command":40},"bunx","bunx skills add w0rxbend\u002Fdot-agents --skill pixijs-scene-container",{"tool":42,"command":43},"pnpm","pnpm dlx skills add w0rxbend\u002Fdot-agents --skill pixijs-scene-container","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fpixi\u002Fpixijs-scene-container\u002FSKILL.md",true,[47,51],{"path":48,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":16},"LICENSE","许可证",1063,{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fscene-core-concepts.md","REFERENCE","参考文档",5932,"https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fpixi\u002Fpixijs-scene-container\u002Freferences\u002Fscene-core-concepts.md",[58,65,72,80,87,94],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":20},"01M7E6TS1SW1ZSXN748N0RBGHT","wiki-builder","Create and maintain a local Markdown research wiki (sources with provenance, compiled concept\u002Fsource pages, index, maintenance log) driven by a per-wiki config. Use when the user wants to start a wiki or knowledge base, ingest sources into one, or query and update it; use wiki-page-writer for a single code deep-dive page.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fwiki-builder\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":20},"01M7E6S8ARS0VQR85H4FEC390B","refactoring-guru","Diagnose a named code smell and apply the smallest behavior-preserving refactoring, with verification before and after and an explicit stop condition. Use for structural refactors (extract, move, consolidate, change ownership), not for feature or bug work; for readability cleanup of recent changes use code-simplification.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Frefactoring-guru\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":76,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":20},"01M7E6RRXCYGSHA0ZBFX3YZP7Y","legacy-seams","When changing untested legacy code, pin the observed results with characterization tests and open the smallest seam that substitutes only the blocking dependency, separate from any later logic change. Use when a clock, random source, I\u002FO, global, or hidden constructor blocks a test or a safe edit. Use test-driven-development for a new behavior or a bug, refactoring-guru for one named structural refactor after the seam exists, and code-refactoring-tech-debt to choose which legacy to replace.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Flegacy-seams\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Flegacy-seams\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":20},"01M7E6QZ11XWSNHCBGYK8HH97C","idea-refine","Refine a raw idea into a one-page brief (problem statement, recommended direction, assumptions to validate, MVP scope, not-doing list) through divergent then convergent thinking. Use when an idea is still vague or you want options and a stress test before committing; use interview-me when the goal itself is unclear and spec-driven-development once the direction is chosen.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fidea-refine\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":20},"01M7E6N2N7BYW7BA5XGM0QD3B4","code-review-and-quality","Review rubric and approval standard for any change before merge, including code written by you, another agent, or a human: five axes (correctness, readability, architecture, security, performance), change sizing, structural remedies, severity labels, and feedback technique. Use to judge whether a change is fit to merge; use code-review to run a PR or diff review end to end.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcode-review-and-quality\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":98,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":20},"01M7E6MNCZPTRD77Z419X755HQ","code-perfection","Smell and style gate for code you write or change. Bans known code smells (long method, large class, primitive obsession, long parameter list, data clumps, duplicate code, dead code, feature envy, shotgun surgery, flag arguments, message chains) and enforces behavior-preserving structure. On Scala files, enforces worxbend style. Use while implementing, reviewing a diff for smells, or when a smell or style violation is suspected. Routine construction stays with code-complete. SOLID and DRY stay with clean-code-guard. One named structural refactor stays with refactoring-guru.","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcode-perfection\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fw0rxbend\u002Fdot-agents\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcode-perfection\u002FSKILL.md",[],[]]