@docyrus/animaguru 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/NOTICE.md +256 -0
  2. package/README.md +241 -0
  3. package/dist/animaguru.js +27338 -0
  4. package/package.json +37 -0
  5. package/skills/animaguru/SKILL.md +115 -0
  6. package/skills/animaguru-advertising/SKILL.md +25 -0
  7. package/skills/animaguru-advertising/references/brand-bumper.md +11 -0
  8. package/skills/animaguru-advertising/references/comparison.md +11 -0
  9. package/skills/animaguru-advertising/references/creator-testimonial.md +11 -0
  10. package/skills/animaguru-advertising/references/editorial-advertorial.md +11 -0
  11. package/skills/animaguru-advertising/references/game-reward.md +11 -0
  12. package/skills/animaguru-advertising/references/offer-promotion.md +11 -0
  13. package/skills/animaguru-advertising/references/product-launch.md +11 -0
  14. package/skills/animaguru-advertising/references/product-proof.md +11 -0
  15. package/skills/animaguru-analog-film-tape/SKILL.md +29 -0
  16. package/skills/animaguru-analog-film-tape/references/recipe.md +23 -0
  17. package/skills/animaguru-animated-data-visualization/SKILL.md +39 -0
  18. package/skills/animaguru-animated-data-visualization/references/data-contract.md +16 -0
  19. package/skills/animaguru-animated-data-visualization/references/variants.md +17 -0
  20. package/skills/animaguru-art-deco-motion/SKILL.md +29 -0
  21. package/skills/animaguru-art-deco-motion/references/recipe.md +22 -0
  22. package/skills/animaguru-ascii-crt/SKILL.md +29 -0
  23. package/skills/animaguru-ascii-crt/references/recipe.md +22 -0
  24. package/skills/animaguru-blueprint-drafting/SKILL.md +29 -0
  25. package/skills/animaguru-blueprint-drafting/references/recipe.md +22 -0
  26. package/skills/animaguru-cartoon-character-animation/SKILL.md +35 -0
  27. package/skills/animaguru-cartoon-character-animation/references/variants.md +17 -0
  28. package/skills/animaguru-cutout-animation/SKILL.md +33 -0
  29. package/skills/animaguru-cutout-animation/references/production-recipe.md +37 -0
  30. package/skills/animaguru-cutout-animation/references/variants.md +17 -0
  31. package/skills/animaguru-cutout-animation/references/visual-style.md +34 -0
  32. package/skills/animaguru-dark-tech-stage/SKILL.md +29 -0
  33. package/skills/animaguru-dark-tech-stage/references/recipe.md +23 -0
  34. package/skills/animaguru-diagram-formula-motion/SKILL.md +36 -0
  35. package/skills/animaguru-diagram-formula-motion/references/variants.md +17 -0
  36. package/skills/animaguru-engraved-relief-print/SKILL.md +29 -0
  37. package/skills/animaguru-engraved-relief-print/references/recipe.md +24 -0
  38. package/skills/animaguru-flat-vector-motion/SKILL.md +35 -0
  39. package/skills/animaguru-flat-vector-motion/references/variants.md +17 -0
  40. package/skills/animaguru-general-video/SKILL.md +20 -0
  41. package/skills/animaguru-general-video/references/ambient-loop.md +11 -0
  42. package/skills/animaguru-general-video/references/music-lyrics.md +11 -0
  43. package/skills/animaguru-general-video/references/short-film.md +11 -0
  44. package/skills/animaguru-general-video/references/titles-event.md +11 -0
  45. package/skills/animaguru-general-video/references/visual-essay.md +11 -0
  46. package/skills/animaguru-generative-light-signal/SKILL.md +29 -0
  47. package/skills/animaguru-generative-light-signal/references/recipe.md +23 -0
  48. package/skills/animaguru-glass-mosaic/SKILL.md +29 -0
  49. package/skills/animaguru-glass-mosaic/references/recipe.md +23 -0
  50. package/skills/animaguru-halftone-editorial/SKILL.md +29 -0
  51. package/skills/animaguru-halftone-editorial/references/recipe.md +23 -0
  52. package/skills/animaguru-holographic-scan/SKILL.md +29 -0
  53. package/skills/animaguru-holographic-scan/references/recipe.md +22 -0
  54. package/skills/animaguru-interface-motion/SKILL.md +36 -0
  55. package/skills/animaguru-interface-motion/references/screen-mapping.md +16 -0
  56. package/skills/animaguru-interface-motion/references/variants.md +17 -0
  57. package/skills/animaguru-isometric-worlds/SKILL.md +35 -0
  58. package/skills/animaguru-isometric-worlds/references/variants.md +17 -0
  59. package/skills/animaguru-kinetic-typography/SKILL.md +35 -0
  60. package/skills/animaguru-kinetic-typography/references/variants.md +17 -0
  61. package/skills/animaguru-miniature-diorama/SKILL.md +29 -0
  62. package/skills/animaguru-miniature-diorama/references/recipe.md +23 -0
  63. package/skills/animaguru-painterly-depth-animation/SKILL.md +35 -0
  64. package/skills/animaguru-painterly-depth-animation/references/variants.md +17 -0
  65. package/skills/animaguru-paper-popup/SKILL.md +29 -0
  66. package/skills/animaguru-paper-popup/references/recipe.md +22 -0
  67. package/skills/animaguru-photo-footage-editorial/SKILL.md +29 -0
  68. package/skills/animaguru-photo-footage-editorial/references/recipe.md +23 -0
  69. package/skills/animaguru-pixel-art-animation/SKILL.md +36 -0
  70. package/skills/animaguru-pixel-art-animation/references/variants.md +17 -0
  71. package/skills/animaguru-portal-zoom/SKILL.md +29 -0
  72. package/skills/animaguru-portal-zoom/references/recipe.md +21 -0
  73. package/skills/animaguru-risograph-print/SKILL.md +29 -0
  74. package/skills/animaguru-risograph-print/references/recipe.md +23 -0
  75. package/skills/animaguru-sand-drawing/SKILL.md +29 -0
  76. package/skills/animaguru-sand-drawing/references/recipe.md +21 -0
  77. package/skills/animaguru-shadow-theatre/SKILL.md +29 -0
  78. package/skills/animaguru-shadow-theatre/references/recipe.md +23 -0
  79. package/skills/animaguru-silkscreen-poster/SKILL.md +29 -0
  80. package/skills/animaguru-silkscreen-poster/references/recipe.md +22 -0
  81. package/skills/animaguru-stop-motion-objects/SKILL.md +29 -0
  82. package/skills/animaguru-stop-motion-objects/references/recipe.md +23 -0
  83. package/skills/animaguru-studio-product-reveal/SKILL.md +29 -0
  84. package/skills/animaguru-studio-product-reveal/references/recipe.md +23 -0
  85. package/skills/animaguru-video/SKILL.md +79 -0
  86. package/skills/animaguru-whiteboard-line-drawing/SKILL.md +34 -0
  87. package/skills/animaguru-whiteboard-line-drawing/references/variants.md +17 -0
  88. package/templates/video/AGENTS.md +34 -0
  89. package/templates/video/CLAUDE.md +19 -0
  90. package/templates/video/README.md +101 -0
  91. package/templates/video/VIDEO-STYLE-NOTICES.txt +54 -0
  92. package/templates/video/film.config.json +10 -0
  93. package/templates/video/gitignore +11 -0
  94. package/templates/video/index.html +14 -0
  95. package/templates/video/package.json +28 -0
  96. package/templates/video/public/brand/logo-mark.svg +5 -0
  97. package/templates/video/scripts/build.mjs +12 -0
  98. package/templates/video/scripts/export-html.mjs +12 -0
  99. package/templates/video/scripts/export-mp4.mjs +209 -0
  100. package/templates/video/scripts/html-export-plugin.mjs +35 -0
  101. package/templates/video/scripts/html-export.mjs +54 -0
  102. package/templates/video/scripts/install-example.mjs +32 -0
  103. package/templates/video/scripts/review-analysis.mjs +29 -0
  104. package/templates/video/scripts/review-audio.mjs +24 -0
  105. package/templates/video/scripts/review.mjs +37 -0
  106. package/templates/video/scripts/starter-film.sha256 +1 -0
  107. package/templates/video/shared/locales/en/export.json +10 -0
  108. package/templates/video/shared/locales/en/film.json +42 -0
  109. package/templates/video/shared/locales/en/player.json +31 -0
  110. package/templates/video/shared/locales/en/style-studies.json +168 -0
  111. package/templates/video/shared/locales/en/timeline.json +33 -0
  112. package/templates/video/src/assets.ts +4 -0
  113. package/templates/video/src/download.ts +27 -0
  114. package/templates/video/src/exporter.ts +70 -0
  115. package/templates/video/src/film-resources.ts +29 -0
  116. package/templates/video/src/film.ts +132 -0
  117. package/templates/video/src/main.ts +219 -0
  118. package/templates/video/src/resource-timeline.ts +193 -0
  119. package/templates/video/src/review.ts +50 -0
  120. package/templates/video/src/studies/film.ts +26 -0
  121. package/templates/video/src/studies/media.ts +46 -0
  122. package/templates/video/src/studies/model.ts +60 -0
  123. package/templates/video/src/studies/pixi-renderer.ts +121 -0
  124. package/templates/video/src/studies/scenes.ts +410 -0
  125. package/templates/video/src/studies/timing.ts +53 -0
  126. package/templates/video/src/studies/variants.ts +39 -0
  127. package/templates/video/src/style.css +111 -0
  128. package/templates/video/src/timeline-model.ts +55 -0
  129. package/templates/video/style-source-provenance.json +11 -0
  130. package/templates/video/tsconfig.json +15 -0
  131. package/templates/video/vite.config.mjs +9 -0
  132. package/vendor/pixijs-skills/LICENSE +21 -0
  133. package/vendor/pixijs-skills/provenance.json +79 -0
  134. package/vendor/pixijs-skills/skills/pixijs/SKILL.md +66 -0
  135. package/vendor/pixijs-skills/skills/pixijs/references/index.md +136 -0
  136. package/vendor/pixijs-skills/skills/pixijs-accessibility/SKILL.md +224 -0
  137. package/vendor/pixijs-skills/skills/pixijs-application/SKILL.md +293 -0
  138. package/vendor/pixijs-skills/skills/pixijs-application/references/application-options.md +314 -0
  139. package/vendor/pixijs-skills/skills/pixijs-assets/SKILL.md +303 -0
  140. package/vendor/pixijs-skills/skills/pixijs-assets/references/background.md +137 -0
  141. package/vendor/pixijs-skills/skills/pixijs-assets/references/bundles.md +122 -0
  142. package/vendor/pixijs-skills/skills/pixijs-assets/references/caching.md +143 -0
  143. package/vendor/pixijs-skills/skills/pixijs-assets/references/compressed-textures.md +120 -0
  144. package/vendor/pixijs-skills/skills/pixijs-assets/references/fonts.md +205 -0
  145. package/vendor/pixijs-skills/skills/pixijs-assets/references/gif.md +171 -0
  146. package/vendor/pixijs-skills/skills/pixijs-assets/references/manifests.md +175 -0
  147. package/vendor/pixijs-skills/skills/pixijs-assets/references/progress.md +142 -0
  148. package/vendor/pixijs-skills/skills/pixijs-assets/references/resolution.md +142 -0
  149. package/vendor/pixijs-skills/skills/pixijs-assets/references/spritesheet.md +119 -0
  150. package/vendor/pixijs-skills/skills/pixijs-assets/references/svg.md +132 -0
  151. package/vendor/pixijs-skills/skills/pixijs-assets/references/video.md +158 -0
  152. package/vendor/pixijs-skills/skills/pixijs-blend-modes/SKILL.md +215 -0
  153. package/vendor/pixijs-skills/skills/pixijs-color/SKILL.md +299 -0
  154. package/vendor/pixijs-skills/skills/pixijs-core-concepts/SKILL.md +132 -0
  155. package/vendor/pixijs-skills/skills/pixijs-core-concepts/references/render-loop.md +216 -0
  156. package/vendor/pixijs-skills/skills/pixijs-core-concepts/references/renderers.md +287 -0
  157. package/vendor/pixijs-skills/skills/pixijs-create/SKILL.md +276 -0
  158. package/vendor/pixijs-skills/skills/pixijs-custom-rendering/SKILL.md +405 -0
  159. package/vendor/pixijs-skills/skills/pixijs-custom-rendering/references/advanced-gpu.md +244 -0
  160. package/vendor/pixijs-skills/skills/pixijs-custom-rendering/references/uniform-types.md +94 -0
  161. package/vendor/pixijs-skills/skills/pixijs-environments/SKILL.md +243 -0
  162. package/vendor/pixijs-skills/skills/pixijs-events/SKILL.md +387 -0
  163. package/vendor/pixijs-skills/skills/pixijs-filters/SKILL.md +300 -0
  164. package/vendor/pixijs-skills/skills/pixijs-html-source/SKILL.md +228 -0
  165. package/vendor/pixijs-skills/skills/pixijs-math/SKILL.md +489 -0
  166. package/vendor/pixijs-skills/skills/pixijs-migration-v8/SKILL.md +415 -0
  167. package/vendor/pixijs-skills/skills/pixijs-performance/SKILL.md +489 -0
  168. package/vendor/pixijs-skills/skills/pixijs-scene-container/SKILL.md +345 -0
  169. package/vendor/pixijs-skills/skills/pixijs-scene-core-concepts/SKILL.md +243 -0
  170. package/vendor/pixijs-skills/skills/pixijs-scene-core-concepts/references/constructor-options.md +155 -0
  171. package/vendor/pixijs-skills/skills/pixijs-scene-core-concepts/references/container-hierarchy.md +232 -0
  172. package/vendor/pixijs-skills/skills/pixijs-scene-core-concepts/references/layers.md +145 -0
  173. package/vendor/pixijs-skills/skills/pixijs-scene-core-concepts/references/masking.md +129 -0
  174. package/vendor/pixijs-skills/skills/pixijs-scene-core-concepts/references/render-groups.md +140 -0
  175. package/vendor/pixijs-skills/skills/pixijs-scene-core-concepts/references/scene-management.md +169 -0
  176. package/vendor/pixijs-skills/skills/pixijs-scene-core-concepts/references/transforms.md +198 -0
  177. package/vendor/pixijs-skills/skills/pixijs-scene-dom-container/SKILL.md +193 -0
  178. package/vendor/pixijs-skills/skills/pixijs-scene-gif/SKILL.md +233 -0
  179. package/vendor/pixijs-skills/skills/pixijs-scene-graphics/SKILL.md +576 -0
  180. package/vendor/pixijs-skills/skills/pixijs-scene-mesh/SKILL.md +141 -0
  181. package/vendor/pixijs-skills/skills/pixijs-scene-mesh/references/mesh-perspective.md +189 -0
  182. package/vendor/pixijs-skills/skills/pixijs-scene-mesh/references/mesh-plane.md +159 -0
  183. package/vendor/pixijs-skills/skills/pixijs-scene-mesh/references/mesh-rope.md +176 -0
  184. package/vendor/pixijs-skills/skills/pixijs-scene-mesh/references/mesh-simple.md +144 -0
  185. package/vendor/pixijs-skills/skills/pixijs-scene-mesh/references/mesh.md +213 -0
  186. package/vendor/pixijs-skills/skills/pixijs-scene-particle-container/SKILL.md +323 -0
  187. package/vendor/pixijs-skills/skills/pixijs-scene-sprite/SKILL.md +120 -0
  188. package/vendor/pixijs-skills/skills/pixijs-scene-sprite/references/animated-sprite.md +262 -0
  189. package/vendor/pixijs-skills/skills/pixijs-scene-sprite/references/nineslice-sprite.md +202 -0
  190. package/vendor/pixijs-skills/skills/pixijs-scene-sprite/references/sprite.md +181 -0
  191. package/vendor/pixijs-skills/skills/pixijs-scene-sprite/references/tiling-sprite.md +216 -0
  192. package/vendor/pixijs-skills/skills/pixijs-scene-text/SKILL.md +136 -0
  193. package/vendor/pixijs-skills/skills/pixijs-scene-text/references/bitmap-text.md +232 -0
  194. package/vendor/pixijs-skills/skills/pixijs-scene-text/references/html-text.md +192 -0
  195. package/vendor/pixijs-skills/skills/pixijs-scene-text/references/split-bitmap-text.md +187 -0
  196. package/vendor/pixijs-skills/skills/pixijs-scene-text/references/split-text.md +168 -0
  197. package/vendor/pixijs-skills/skills/pixijs-scene-text/references/text.md +311 -0
  198. package/vendor/pixijs-skills/skills/pixijs-ticker/SKILL.md +292 -0
@@ -0,0 +1,345 @@
1
+ ---
2
+ name: pixijs-scene-container
3
+ description: "Use this skill when grouping, positioning, or transforming display objects in PixiJS v8. Covers Container constructor options (isRenderGroup, sortableChildren, boundsArea), addChild/removeChild/addChildAt/swapChildren/setChildIndex, position/scale/rotation/pivot/skew/alpha/tint, getBounds/getGlobalPosition/toLocal/toGlobal, zIndex sorting, cullable, onRender per-frame callback, destroy. Triggers on: Container, addChild, removeChild, addChildAt, swapChildren, sortableChildren, zIndex, position, scale, rotation, pivot, getBounds, toGlobal, toLocal, onRender, destroy, constructor options, ContainerOptions."
4
+ license: MIT
5
+ ---
6
+
7
+ `Container` is the general-purpose node of the PixiJS v8 scene graph. It holds children and applies transforms, alpha, tint, and blend mode to its whole subtree. Every display object you make will either be a `Container` you're building a branch on, or a leaf (`Sprite`, `Graphics`, `Text`, `Mesh`) that you nest inside one.
8
+
9
+ Assumes familiarity with `pixijs-scene-core-concepts`.
10
+
11
+ ## Quick Start
12
+
13
+ ```ts
14
+ const group = new Container({
15
+ label: "hero-group",
16
+ x: 200,
17
+ y: 150,
18
+ sortableChildren: true,
19
+ });
20
+
21
+ const body = new Sprite(await Assets.load("body.png"));
22
+ const head = new Sprite(await Assets.load("head.png"));
23
+ head.position.set(0, -40);
24
+ head.zIndex = 1;
25
+
26
+ group.addChild(body, head);
27
+ group.pivot.set(group.width / 2, group.height / 2);
28
+ group.scale.set(1.5);
29
+
30
+ app.stage.addChild(group);
31
+ ```
32
+
33
+ **Related skills:** `pixijs-scene-core-concepts` (scene graph mental model, masking, layers, render groups), `pixijs-scene-sprite` / `pixijs-scene-graphics` / `pixijs-scene-text` / `pixijs-scene-mesh` (leaf objects that go inside containers), `pixijs-events` (`eventMode`, hit testing), `pixijs-math` (Matrix, toGlobal/toLocal detail), `pixijs-performance` (`cacheAsTexture`, culling, render groups).
34
+
35
+ ## Core Patterns
36
+
37
+ ### Constructor options
38
+
39
+ ```ts
40
+ const container = new Container({
41
+ label: "world",
42
+ x: 100,
43
+ y: 50,
44
+ scale: 2,
45
+ rotation: Math.PI / 4,
46
+ alpha: 0.8,
47
+ visible: true,
48
+ tint: 0xffaa00,
49
+ blendMode: "add",
50
+ sortableChildren: true,
51
+ isRenderGroup: true,
52
+ origin: { x: 0, y: 0 },
53
+ boundsArea: new Rectangle(0, 0, 1920, 1080),
54
+ });
55
+ ```
56
+
57
+ All `Container` options (`position`, `scale`, `tint`, `label`, `filters`, `zIndex`, etc.) are also valid here — see `skills/pixijs-scene-core-concepts/references/constructor-options.md`.
58
+
59
+ The `Container` constructor uses `assignWithIgnore` to bulk-copy every field in the options object onto the instance except `children`, `parent`, and `effects`. Any public property of `Container` is a valid constructor option: `cullable`, `cullArea`, `mask`, `filterArea`, `eventMode`, `hitArea`, and so on. The options block above groups the most common ones; see the shared reference above for the full list.
60
+
61
+ `isRenderGroup: true` promotes the container to its own render group so its transforms are applied on the GPU rather than recomputed per-child on the CPU. Use it on stable sub-trees (large static worlds, UI layers). Don't overuse; most scenes don't need explicit render groups and too many hurts performance. Profile before promoting. See `pixijs-scene-core-concepts/references/scene-management.md`.
62
+
63
+ `sortableChildren: true` causes children to be re-sorted by `zIndex` at the next render. See `zIndex` below.
64
+
65
+ `origin` is a first-class v8 transform helper: an `ObservablePoint` that acts as a rotation/scale center **without** moving the container. Where `pivot` shifts the projection of the local origin in parent space (so changing it displaces the object), `origin` leaves position alone and simply rotates/scales around the specified local point. Accepts `PointData`, a single number (applied to both axes), or can be set live via `container.origin.set(x, y)`. Setting both `pivot` and `origin` on the same container produces compounding behavior and is discouraged; pick one.
66
+
67
+ `boundsArea` forces `getBounds()` to return a fixed rectangle instead of recursively measuring children; it is a performance win for containers with hundreds of cheap, predictable children.
68
+
69
+ `cullable` and `cullArea` are valid constructor options (the `assignWithIgnore` pass copies them like any other field), but they are documented in `pixijs-performance` because culling setup is a performance concern rather than a scene-graph concern.
70
+
71
+ ### Leaves vs containers
72
+
73
+ ```ts
74
+ const parent = new Container();
75
+ const sprite = new Sprite(texture);
76
+
77
+ parent.addChild(sprite);
78
+ ```
79
+
80
+ Only `Container` (and subclasses intended to hold children, like `RenderLayer`) should have children. `Sprite`, `Graphics`, `Text`, `Mesh`, `ParticleContainer` particles, and `DOMContainer` content are leaves by convention in PixiJS v8. Wrap them in a `Container` whenever you need to group things: give the container the layout logic and keep the leaves pure visual data. Adding children to a leaf logs a deprecation warning and is scheduled to become a hard error.
81
+
82
+ ### Adding and removing children
83
+
84
+ ```ts
85
+ const parent = new Container();
86
+
87
+ parent.addChild(a, b, c);
88
+ parent.addChildAt(d, 0);
89
+ parent.swapChildren(a, b);
90
+ parent.setChildIndex(c, 0);
91
+
92
+ parent.removeChild(b);
93
+ parent.removeChildAt(0);
94
+ parent.removeChildren();
95
+
96
+ parent.removeChildren(0, 2);
97
+ ```
98
+
99
+ `addChild` accepts any number of children and returns the first one. Children render in array order: index 0 is drawn first (behind), the last index is drawn last (in front). `addChildAt` inserts at a specific index; `setChildIndex` moves an existing child; `swapChildren` exchanges two children's positions.
100
+
101
+ `removeChildren(beginIndex?, endIndex?)` removes a slice and returns the removed array.
102
+
103
+ Calling `addChildAt` with a child that already belongs to the same container silently moves it to the new index. No `added` / `childAdded` / `removed` / `childRemoved` events fire, because the parent-child relationship didn't change. Events only fire when the child comes from a different parent (or from no parent).
104
+
105
+ For reparenting that preserves world transform (so the child doesn't visually jump), use `reparentChild` / `reparentChildAt`. For swapping a child in place while copying the old child's local transform, use `replaceChild`.
106
+
107
+ ### Transform properties
108
+
109
+ ```ts
110
+ const obj = new Container();
111
+
112
+ obj.x = 100;
113
+ obj.y = 200;
114
+ obj.position.set(100, 200);
115
+
116
+ obj.scale.set(2);
117
+ obj.scale = 2;
118
+
119
+ obj.rotation = Math.PI / 4;
120
+ obj.angle = 45;
121
+
122
+ obj.pivot.set(50, 50);
123
+ obj.skew.set(0.1, 0.2);
124
+
125
+ obj.alpha = 0.5;
126
+ obj.tint = 0xff0000;
127
+ obj.visible = false;
128
+ obj.renderable = false;
129
+ ```
130
+
131
+ - `position`, `scale`, `pivot`, `skew` are `ObservablePoint`s. Assigning `scale = 2` is valid and sets both axes.
132
+ - `rotation` is radians; `angle` is degrees; they are aliases that stay in sync.
133
+ - `pivot` sets the point in local space that maps to `position` in parent space; changing it both moves and rotates the container.
134
+ - `alpha` and `tint` multiply down through children. `blendMode` applies to this container's draw instructions.
135
+ - `visible = false` skips rendering and transform updates. `renderable = false` skips rendering but still updates transforms (use when you need `getBounds()` or hit-testing without drawing).
136
+
137
+ ### zIndex and sortableChildren
138
+
139
+ ```ts
140
+ const world = new Container({ sortableChildren: true });
141
+
142
+ const ground = new Sprite(groundTexture);
143
+ ground.zIndex = 0;
144
+
145
+ const player = new Sprite(playerTexture);
146
+ player.zIndex = 10;
147
+
148
+ const ui = new Sprite(uiTexture);
149
+ ui.zIndex = 100;
150
+
151
+ world.addChild(ground, player, ui);
152
+ ```
153
+
154
+ When `sortableChildren` is `true`, the container re-sorts its children by `zIndex` before the next render. Changing any child's `zIndex` automatically re-marks the parent as needing sort. Sort only what you need to sort; leaving `sortableChildren` off is cheaper. If you want full manual control, call `container.sortChildren()` yourself after changing `zIndex` values.
155
+
156
+ For render-order control that is decoupled from the hierarchy (children keep their logical parent for transforms but render at a different z), use `RenderLayer`. See `pixijs-scene-core-concepts/references/scene-management.md`.
157
+
158
+ ### Bounds and coordinate conversion
159
+
160
+ ```ts
161
+ const bounds = container.getBounds();
162
+ console.log(bounds.x, bounds.y, bounds.width, bounds.height);
163
+
164
+ const rect = container.getBounds().rectangle;
165
+
166
+ const local = new Point(10, 20);
167
+ const world = container.toGlobal(local);
168
+ const backToLocal = container.toLocal(world);
169
+
170
+ const selfPos = container.getGlobalPosition();
171
+ ```
172
+
173
+ `getBounds()` returns a `Bounds` object (not a `Rectangle`); it exposes `x`, `y`, `width`, `height`, and a `.rectangle` getter for APIs that need an actual `Rectangle`. The signature is `getBounds(skipUpdate?: boolean, bounds?: Bounds)` — pass `true` as the first arg to skip the forced transform update, and an optional `Bounds` instance as the second arg to avoid allocating a new one.
174
+
175
+ `toGlobal(point)` converts a point in this container's local space to scene-root space. `toLocal(point, from?)` converts from another container's local space (or global space if `from` is omitted). `getGlobalPosition()` is shorthand for `parent.toGlobal(this._position)`.
176
+
177
+ ### Sizing
178
+
179
+ ```ts
180
+ const sprite = new Sprite(texture);
181
+
182
+ sprite.setSize(200, 100);
183
+ const { width, height } = sprite.getSize();
184
+ ```
185
+
186
+ `setSize` adjusts `scale` so the container's bounds fit the requested pixel size, in one operation. Setting `.width` and `.height` individually works, but each assignment triggers a separate bounds recomputation; prefer `setSize` when changing both axes.
187
+
188
+ ### Container events
189
+
190
+ ```ts
191
+ const parent = new Container();
192
+
193
+ parent.on("childAdded", (child, container, index) => {
194
+ console.log("added at", index, child.label);
195
+ });
196
+
197
+ parent.on("childRemoved", (child, container, index) => {
198
+ console.log("removed from", index);
199
+ });
200
+
201
+ const child = new Container();
202
+ child.on("added", (newParent) => console.log("entered", newParent.label));
203
+ child.on("removed", (oldParent) => console.log("left", oldParent.label));
204
+ child.on("visibleChanged", (visible) => console.log("visible:", visible));
205
+ child.on("destroyed", (destroyed) => console.log("gone", destroyed.label));
206
+
207
+ parent.addChild(child);
208
+ ```
209
+
210
+ | Event | Fires on | Arguments |
211
+ | ---------------- | ------------------------------------- | --------------------------- |
212
+ | `childAdded` | the parent receiving the child | `(child, container, index)` |
213
+ | `childRemoved` | the parent losing the child | `(child, container, index)` |
214
+ | `added` | the child that was attached | `(parent)` |
215
+ | `removed` | the child that was detached | `(parent)` |
216
+ | `destroyed` | the destroyed container | `(container)` |
217
+ | `visibleChanged` | the container whose `visible` flipped | `(visible)` |
218
+
219
+ These are emitted on the `EventEmitter` side of `Container`; do not confuse them with pointer events from `pixijs-events`.
220
+
221
+ `destroyed` fires after internal cleanup but before listeners are removed, so by the time your handler runs `position`, `scale`, `pivot`, `origin`, `skew`, and `parent` have already been nulled, and `children` has been emptied (length 0, but the array reference itself is not nulled). Capture any data you need from the container _before_ calling `destroy()`, not inside the handler.
222
+
223
+ ### Per-frame updates with onRender
224
+
225
+ ```ts
226
+ const container = new Container();
227
+
228
+ container.onRender = (renderer) => {
229
+ container.rotation += 0.01;
230
+ };
231
+
232
+ container.onRender = null;
233
+ ```
234
+
235
+ `onRender` runs every frame while the container is being rendered, and receives the active `Renderer`. Use it for lightweight animation or per-frame updates tied to a specific container. In v7 this pattern was done by overriding `updateTransform`, which no longer runs every frame in v8. Set `onRender = null` to detach the callback.
236
+
237
+ ### Finding and removing from parent
238
+
239
+ ```ts
240
+ const player = world.getChildByLabel("player");
241
+ const enemies = world.getChildrenByLabel(/enemy-\d+/, true);
242
+
243
+ const bounds = hud.getLocalBounds();
244
+
245
+ oldSprite.removeFromParent();
246
+ ```
247
+
248
+ - `getChildByLabel(label, deep?)` — first match by string or `RegExp`. Pass `true` for a recursive search.
249
+ - `getChildrenByLabel(label, deep?, out?)` — all matches. Accepts an optional reusable output array.
250
+ - `getLocalBounds()` — bounds in this container's own coordinate space, ignoring parent transforms. Cheaper than `getBounds()` for self-contained layout math.
251
+ - `removeFromParent()` — detaches `this` from its current parent (no-op if already orphaned).
252
+
253
+ ### Destroy
254
+
255
+ ```ts
256
+ container.destroy();
257
+
258
+ container.destroy({
259
+ children: true,
260
+ texture: true,
261
+ textureSource: true,
262
+ });
263
+
264
+ console.log(container.destroyed);
265
+ ```
266
+
267
+ By default `destroy()` unlinks this container from its parent and tears down its own state. Pass `{ children: true }` to recursively destroy every descendant; this is the usual call for killing a whole subtree. `texture: true` and `textureSource: true` additionally destroy the GPU resources referenced by leaf children (useful for sprites whose textures you loaded just for them). If `cacheAsTexture` is on, disable it with `container.cacheAsTexture(false)` before destroying.
268
+
269
+ ## Common Mistakes
270
+
271
+ ### [CRITICAL] Adding children to leaf scene objects
272
+
273
+ Wrong:
274
+
275
+ ```ts
276
+ const sprite = new Sprite(texture);
277
+ const overlay = new Sprite(overlayTexture);
278
+ sprite.addChild(overlay);
279
+ ```
280
+
281
+ Correct:
282
+
283
+ ```ts
284
+ const group = new Container();
285
+ const sprite = new Sprite(texture);
286
+ const overlay = new Sprite(overlayTexture);
287
+ group.addChild(sprite, overlay);
288
+ ```
289
+
290
+ Sprites, Graphics, Text, and Mesh are leaves. Adding children to them logs a deprecation warning now and will be an error in a future version. Always wrap them in a `Container` when you need grouping.
291
+
292
+ ### [HIGH] Expecting getBounds() to return a Rectangle
293
+
294
+ Wrong:
295
+
296
+ ```ts
297
+ const rect = container.getBounds();
298
+ rect.contains(x, y); // TypeError: contains is not a function
299
+ ```
300
+
301
+ Correct:
302
+
303
+ ```ts
304
+ const rect = container.getBounds().rectangle;
305
+ rect.contains(x, y);
306
+
307
+ const bounds = container.getBounds();
308
+ console.log(bounds.width, bounds.height);
309
+ ```
310
+
311
+ `getBounds()` returns a `Bounds` instance in v8. Its basic getters (`x`, `y`, `width`, `height`) work, but for `Rectangle`-specific methods like `.contains()` or passing to APIs that require a `Rectangle`, read the `.rectangle` property.
312
+
313
+ ### [HIGH] Using cacheAsBitmap instead of cacheAsTexture
314
+
315
+ Wrong:
316
+
317
+ ```ts
318
+ container.cacheAsBitmap = true;
319
+ ```
320
+
321
+ Correct:
322
+
323
+ ```ts
324
+ container.cacheAsTexture(true);
325
+ ```
326
+
327
+ `cacheAsBitmap` (v7 property) was renamed to `cacheAsTexture()` (a method) in v8. Always disable it with `cacheAsTexture(false)` before calling `destroy()`.
328
+
329
+ ### [MEDIUM] Using container.name instead of container.label
330
+
331
+ `name` was renamed to `label` in v8. The old property still works as a deprecated alias; `getChildByLabel` is the v8 way to look up children by name.
332
+
333
+ ### [MEDIUM] Setting both pivot and origin on the same container
334
+
335
+ Pivot shifts the projection of the local origin in parent space (moves the object as a side-effect of changing the rotation center). Origin changes the rotation/scale center without displacement. Setting both on the same container produces unexpected compounding; pick one.
336
+
337
+ ## API Reference
338
+
339
+ - [Container](https://pixijs.download/release/docs/scene.Container.html.md)
340
+ - [ContainerOptions](https://pixijs.download/release/docs/scene.ContainerOptions.html.md)
341
+ - [ViewContainer](https://pixijs.download/release/docs/scene.ViewContainer.html.md)
342
+ - [Bounds](https://pixijs.download/release/docs/rendering.Bounds.html.md)
343
+ - [Point](https://pixijs.download/release/docs/maths.Point.html.md)
344
+ - [ObservablePoint](https://pixijs.download/release/docs/maths.ObservablePoint.html.md)
345
+ - [RenderGroup](https://pixijs.download/release/docs/rendering.RenderGroup.html.md)
@@ -0,0 +1,243 @@
1
+ ---
2
+ name: pixijs-scene-core-concepts
3
+ description: "Use this skill when reasoning about the PixiJS v8 scene graph as a whole: how containers, leaves, transforms, and render order fit together. Covers leaf vs container distinction, local/world coordinates, culling, render groups, sortable children, masking, RenderLayer, constructor options shared by every scene node, and which leaf skill covers which display object. Triggers on: scene graph, display list, Container, Sprite, Graphics, Text, Mesh, ParticleContainer, DOMContainer, GifSprite, masking, render group, RenderLayer, world transform, constructor options, ContainerOptions."
4
+ license: MIT
5
+ ---
6
+
7
+ This skill is the shared mental model referenced by all `pixijs-scene-*` leaves. It explains what the scene graph is in PixiJS v8, how a `Container` differs from a leaf, and where each concept lives. It does not go deep on any single API; it frames the pieces and points to the skill or reference file that does.
8
+
9
+ ## Quick Start
10
+
11
+ ```ts
12
+ const world = new Container({ isRenderGroup: true });
13
+ app.stage.addChild(world);
14
+
15
+ const hero = new Container({ label: "hero" });
16
+ hero.addChild(new Sprite(bodyTexture));
17
+ hero.addChild(new Sprite(faceTexture));
18
+ world.addChild(hero);
19
+
20
+ const mask = new Graphics().rect(0, 0, 800, 600).fill(0xffffff);
21
+ world.mask = mask;
22
+ world.addChild(mask);
23
+
24
+ hero.position.set(world.width / 2, world.height / 2);
25
+ ```
26
+
27
+ **Related skills:** `pixijs-scene-container` (Container API in detail), the leaf skills (`pixijs-scene-sprite`, `pixijs-scene-graphics`, `pixijs-scene-text`, `pixijs-scene-mesh`, `pixijs-scene-particle-container`, `pixijs-scene-dom-container`, `pixijs-scene-gif`), `pixijs-events` (hit testing traverses the scene graph), `pixijs-performance` (cache, culling, render groups), `pixijs-math` (Matrix, toGlobal/toLocal detail).
28
+
29
+ ## Core Concepts
30
+
31
+ ### What the scene graph is
32
+
33
+ The PixiJS scene graph is a tree of display objects rooted at `app.stage`. Each node has a parent, a transform (position, scale, rotation, pivot, skew) relative to its parent, and optional visual state (alpha, tint, blendMode, visibility). Each frame the renderer walks the tree, composes transforms and visual state down to world-space, culls what's offscreen, and emits draw calls. The scene graph is both the layout model and the render order: earlier siblings draw behind later siblings.
34
+
35
+ Every display object in v8 is a `Container` subclass. `DisplayObject` from earlier versions was removed.
36
+
37
+ ### Container vs leaf (CRITICAL)
38
+
39
+ There are two roles in the tree:
40
+
41
+ - **Containers**: nodes that hold children. Use a `Container` (or `RenderLayer`) for any node that groups, positions, or transforms other nodes.
42
+ - **Leaves**: nodes that draw something and have no children. Use `Sprite`, `Graphics`, `Text`, `Mesh`, `ParticleContainer`'s `Particle`, `DOMContainer`, or `GifSprite` as leaves.
43
+
44
+ In PixiJS v8, leaves must not have children. Adding children to a `Sprite` / `Graphics` / `Text` / `Mesh` logs a deprecation warning and is scheduled to become a hard error. The rule is: **use `Container` for any node that needs children; do not nest children inside leaf scene objects.** If you need to group a leaf with other leaves, wrap them in a `Container`.
45
+
46
+ This distinction is why the `pixijs-scene-*` skills are split the way they are: `pixijs-scene-container` covers the grouping node, and each leaf gets its own skill focused on its draw behavior.
47
+
48
+ ### Transforms and coordinate spaces
49
+
50
+ Every container composes a `localTransform` (a `Matrix`) from its `position`, `scale`, `rotation`, `pivot`, and `skew`. The renderer multiplies parents' local transforms together to produce the `worldTransform` (and `groupTransform` if a render group is in the chain), which maps local points to scene-root space. Use `toGlobal(point)` and `toLocal(point, from?)` to convert between spaces, and `getGlobalPosition()` for this object's world position. Full Matrix detail lives in `pixijs-math`; transform setters and `toLocal`/`toGlobal` live in `pixijs-scene-container`.
51
+
52
+ ### Render order and explicit z-ordering
53
+
54
+ Children render in array order: index 0 first, last index last. For explicit z-ordering on a single container, set `sortableChildren = true` and assign `zIndex` values to children. For render order that is decoupled from the logical hierarchy (e.g., a character's parent is a game world but its drawing happens on a UI layer), use `RenderLayer`. Deep detail, including when to prefer sortable children vs RenderLayer, is in `references/scene-management.md`.
55
+
56
+ ### Render groups
57
+
58
+ Flagging a container with `isRenderGroup: true` (or calling `container.enableRenderGroup()`) tells PixiJS to apply its transform on the GPU as a single matrix instead of recomputing every descendant's world transform on the CPU each frame. Use render groups on large, stable sub-trees such as worlds, UI layers, or parallax strips. Deep detail in `references/scene-management.md`.
59
+
60
+ ### Culling
61
+
62
+ `cullable = true` + a `cullArea: Rectangle` tells the `CullerPlugin` (or any culling pass) to skip rendering objects that fall outside the visible area. `cullableChildren = false` short-circuits recursive culling for a sub-tree whose children are always on screen. Culling is a performance topic; `pixijs-performance` and `references/scene-management.md` cover the trade-offs.
63
+
64
+ ### Masking
65
+
66
+ Set `container.mask` to another display object to clip its rendering. PixiJS picks the mask type automatically: a `Graphics` or `Container` mask uses a stencil buffer, a `Sprite` mask uses an alpha filter, and a number selects a `ColorMask`. All four mask types (AlphaMask, StencilMask, ScissorMask, ColorMask) are covered in `references/masking.md`.
67
+
68
+ ### Visibility, alpha, tint, and blend mode
69
+
70
+ `visible = false` skips rendering and transform updates; `renderable = false` skips rendering but still updates transforms (use when hit-testing or bounds queries need to stay live). `alpha` and `tint` multiply down through the sub-tree; `blendMode` controls how this container's draw instructions composite against what is already on the target. See `pixijs-blend-modes` for the full blend-mode list and `pixijs-scene-container` for per-node state.
71
+
72
+ ### Destroy semantics
73
+
74
+ `container.destroy()` unlinks one node. `container.destroy({ children: true })` recursively destroys the whole sub-tree; always use this for killing a branch. `texture: true` and `textureSource: true` additionally tear down GPU resources owned by leaves. If `cacheAsTexture` is on, disable it before destroying. `pixijs-scene-container` documents the full signature.
75
+
76
+ ### Lifecycle events
77
+
78
+ Containers emit events for hierarchy and visibility changes: `childAdded` / `childRemoved` on the parent, `added` / `removed` on the child, plus `visibleChanged` and `destroyed` on the container itself. Useful for wiring reactive UI updates or resource bookkeeping. Full details in `references/container-hierarchy.md`.
79
+
80
+ ## Leaf comparison: which skill covers which object
81
+
82
+ | Leaf | Primary use | Skill |
83
+ | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
84
+ | `Sprite` | Draw a single texture at a position (with variants `NineSliceSprite` for resizable UI panels and `TilingSprite` for repeating backgrounds). | `pixijs-scene-sprite` |
85
+ | `Text` / `BitmapText` / `HTMLText` / `SplitText` / `SplitBitmapText` | Render text. Canvas-based `Text` for general use, `BitmapText` for high-volume cheap text, `HTMLText` for rich HTML/CSS layout, split variants for per-character animation. | `pixijs-scene-text` |
86
+ | `Graphics` | Vector drawing: shapes, lines, paths, fills, strokes. Backed by a `GraphicsContext`. | `pixijs-scene-graphics` |
87
+ | `Mesh` / `MeshSimple` / `MeshPlane` / `MeshRope` / `PerspectiveMesh` | Custom geometry with a shader or texture. Use `MeshRope` for textured path-following ribbons and `PerspectiveMesh` for 2D perspective. | `pixijs-scene-mesh` |
88
+ | `ParticleContainer` + `Particle` | Thousands of lightweight sprites with a restricted transform set, for high-throughput particle effects. | `pixijs-scene-particle-container` |
89
+ | `DOMContainer` | Render an HTML element positioned inside the scene graph (useful for inputs, iframes, accessibility overlays). | `pixijs-scene-dom-container` |
90
+ | `GifSprite` | Animated GIF playback as a display object. Requires `pixi.js/gif`. | `pixijs-scene-gif` |
91
+
92
+ `Container` itself is covered in `pixijs-scene-container` and is the node every leaf lives inside.
93
+
94
+ ## When to use what (quick decisions)
95
+
96
+ - "I want to group and transform some display objects" → `Container`, see `pixijs-scene-container`.
97
+ - "I want to draw a texture" → `Sprite`, see `pixijs-scene-sprite`.
98
+ - "I want to draw vector shapes or paths" → `Graphics`, see `pixijs-scene-graphics`.
99
+ - "I want to draw text" → `Text` / `BitmapText` / `HTMLText`, see `pixijs-scene-text`.
100
+ - "I want thousands of cheap sprites" → `ParticleContainer`, see `pixijs-scene-particle-container`.
101
+ - "I want a custom-geometry mesh or a deformed sprite" → `Mesh` or one of its variants, see `pixijs-scene-mesh`.
102
+ - "I want to clip a sub-tree" → set `.mask`, see `references/masking.md`.
103
+ - "I want a decoupled render order" → `RenderLayer`, see `references/scene-management.md`.
104
+ - "I want GPU-level transforms for a big stable sub-tree" → `isRenderGroup: true`, see `references/scene-management.md`.
105
+ - "I want to skip offscreen rendering" → `cullable = true` + `CullerPlugin`, see `pixijs-performance`.
106
+
107
+ ## References
108
+
109
+ - [references/constructor-options.md](references/constructor-options.md): the ~30 fields inherited by every `Container`-derived node (transform, display, hierarchy, sorting, layout, effects, callbacks), with defaults, types, and when line-by-line assignment is appropriate. Shared reference for all leaf skills.
110
+ - [references/container-hierarchy.md](references/container-hierarchy.md): add/remove/swap children, reparenting with transform preservation, label navigation, destroy sub-trees.
111
+ - [references/transforms.md](references/transforms.md): position, scale, rotation, pivot, origin, skew, toGlobal/toLocal, the three matrices (local/group/world), bounds.
112
+ - [references/masking.md](references/masking.md): AlphaMask, StencilMask, ScissorMask, ColorMask, inverse masking, cost comparison.
113
+ - [references/layers.md](references/layers.md): `RenderLayer`, attach/detach, sorted layers, layer + logical parent split.
114
+ - [references/render-groups.md](references/render-groups.md): `isRenderGroup`, GPU-level transforms, when to use, render-groups vs `cacheAsTexture`.
115
+ - [references/scene-management.md](references/scene-management.md): combined view; render groups, `RenderLayer`, culling, zIndex sorting, `boundsArea`.
116
+
117
+ ## Common Mistakes
118
+
119
+ ### [CRITICAL] Adding children to a leaf display object
120
+
121
+ Wrong:
122
+
123
+ ```ts
124
+ const sprite = new Sprite(texture);
125
+ sprite.addChild(new Graphics().rect(0, 0, 10, 10).fill(0xff0000));
126
+ ```
127
+
128
+ Correct:
129
+
130
+ ```ts
131
+ const group = new Container();
132
+ group.addChild(new Sprite(texture));
133
+ group.addChild(new Graphics().rect(0, 0, 10, 10).fill(0xff0000));
134
+ ```
135
+
136
+ In v8 leaves (`Sprite`, `Graphics`, `Text`, `Mesh`, `ParticleContainer`, `DOMContainer`, `GifSprite`) technically extend `Container` but should not hold children. Adding children to a leaf produces undefined rendering behavior. Wrap the leaf in a `Container` when you need grouping.
137
+
138
+ ### [CRITICAL] Referencing DisplayObject
139
+
140
+ Wrong:
141
+
142
+ ```ts
143
+ import { DisplayObject } from "pixi.js"; // no such export in v8
144
+ function moveNode(node: DisplayObject) {
145
+ node.x += 1;
146
+ }
147
+ ```
148
+
149
+ Correct:
150
+
151
+ ```ts
152
+ import { Container } from "pixi.js";
153
+ function moveNode(node: Container) {
154
+ node.x += 1;
155
+ }
156
+ ```
157
+
158
+ `DisplayObject` was removed in v8. Every display object — including `Sprite`, `Graphics`, `Text`, `Mesh` — is a `Container` subclass now. Use `Container` as the base type.
159
+
160
+ ### [HIGH] Forgetting isRenderGroup on large static subtrees
161
+
162
+ Wrong:
163
+
164
+ ```ts
165
+ const world = new Container();
166
+ for (let i = 0; i < 5000; i++) {
167
+ world.addChild(new Sprite(texture));
168
+ }
169
+ app.stage.addChild(world);
170
+ ```
171
+
172
+ Correct:
173
+
174
+ ```ts
175
+ const world = new Container({ isRenderGroup: true });
176
+ for (let i = 0; i < 5000; i++) {
177
+ world.addChild(new Sprite(texture));
178
+ }
179
+ app.stage.addChild(world);
180
+ ```
181
+
182
+ Without `isRenderGroup: true`, the renderer recomposes every child's transform against its parents every frame. Marking the subtree as a render group caches transforms and draw state until a child changes, which is essential for large or mostly-static trees.
183
+
184
+ ### [HIGH] Treating child.x as world space
185
+
186
+ Wrong:
187
+
188
+ ```ts
189
+ const enemy = new Container();
190
+ enemy.x = 500;
191
+ world.addChild(enemy);
192
+ world.x = 200;
193
+ console.log(enemy.x); // 500 (local), not 700 (world)
194
+ ```
195
+
196
+ Correct:
197
+
198
+ ```ts
199
+ const worldPos = enemy.toGlobal({ x: 0, y: 0 });
200
+ console.log(worldPos.x); // 700
201
+ ```
202
+
203
+ `Container.x/y/scale/rotation` are LOCAL to the parent. Use `toGlobal(point)` to compute world-space coordinates, or `getGlobalPosition()` for the container's origin in world space. The world transform is not exposed as a simple `x/y` pair.
204
+
205
+ ### [MEDIUM] sortableChildren without zIndex
206
+
207
+ Wrong:
208
+
209
+ ```ts
210
+ const layer = new Container();
211
+ layer.sortableChildren = true;
212
+ layer.addChild(bg); // no zIndex
213
+ layer.addChild(mid); // no zIndex
214
+ layer.addChild(fg); // no zIndex
215
+ // order is unchanged — all zIndex default to 0
216
+ ```
217
+
218
+ Correct:
219
+
220
+ ```ts
221
+ const layer = new Container();
222
+ layer.sortableChildren = true;
223
+ bg.zIndex = 0;
224
+ mid.zIndex = 10;
225
+ fg.zIndex = 20;
226
+ layer.addChild(bg, mid, fg);
227
+ ```
228
+
229
+ `sortableChildren` re-sorts children by `zIndex` before rendering, but only takes effect when children actually have distinct `zIndex` values. Setting only the parent flag has no visible effect.
230
+
231
+ ## Tooling
232
+
233
+ The [PixiJS Devtools Chrome extension](https://chromewebstore.google.com/detail/pixijs-devtools/aamddddknhcagpehecnhphigffljadon) lets you inspect and manipulate a running scene graph in real time. Install it for any non-trivial layout or render-order debugging.
234
+
235
+ ## API Reference
236
+
237
+ - [Container](https://pixijs.download/release/docs/scene.Container.html.md)
238
+ - [ViewContainer](https://pixijs.download/release/docs/scene.ViewContainer.html.md)
239
+ - [RenderLayer](https://pixijs.download/release/docs/scene.RenderLayer.html.md)
240
+ - [RenderGroup](https://pixijs.download/release/docs/rendering.RenderGroup.html.md)
241
+ - [Bounds](https://pixijs.download/release/docs/rendering.Bounds.html.md)
242
+ - [Culler](https://pixijs.download/release/docs/scene.Culler.html.md)
243
+ - [CullerPlugin](https://pixijs.download/release/docs/app.CullerPlugin.html.md)