Logo: Pixijs Scene Core Concepts

Pixijs Scene Core Concepts

Organisatioun
pixijs
pixijs-scene-core-concepts

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.

Add to TypingMind

Iwwersiicht

Editeurpixijs
Repositorypixijs-skills
Skill-Nummpixijs-scene-core-concepts
Stären
357
Forks
19
Matgeliwwert Dateien
7
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 7 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    pixijs huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Pixijs Scene Core Concepts an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/pixijs/pixijs-skills/tree/main/skills/pixijs-scene-core-concepts
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/pixijs/pixijs-skills.git /tmp/pixijs-skills
mkdir -p .claude/skills
cp -r /tmp/pixijs-skills/skills/pixijs-scene-core-concepts .claude/skills/pixijs-scene-core-concepts
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Pixijs Scene Core Concepts an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Pixijs Scene Core Concepts automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Pixijs Scene Core Concepts net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Quick Start

ts
const world = new Container({ isRenderGroup: true });
app.stage.addChild(world);

const hero = new Container({ label: "hero" });
hero.addChild(new Sprite(bodyTexture));
hero.addChild(new Sprite(faceTexture));
world.addChild(hero);

const mask = new Graphics().rect(0, 0, 800, 600).fill(0xffffff);
world.mask = mask;
world.addChild(mask);

hero.position.set(world.width / 2, world.height / 2);

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).

Core Concepts

What the scene graph is

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.

Every display object in v8 is a Container subclass. DisplayObject from earlier versions was removed.

Container vs leaf (CRITICAL)

There are two roles in the tree:

  • Containers: nodes that hold children. Use a Container (or RenderLayer) for any node that groups, positions, or transforms other nodes.
  • Leaves: nodes that draw something and have no children. Use Sprite, Graphics, Text, Mesh, ParticleContainer's Particle, DOMContainer, or GifSprite as leaves.

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.

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.

Transforms and coordinate spaces

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.

Render order and explicit z-ordering

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.

Render groups

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.

Culling

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.

Masking

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.

Visibility, alpha, tint, and blend mode

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.

Destroy semantics

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.

Lifecycle events

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.

Leaf comparison: which skill covers which object

LeafPrimary useSkill
SpriteDraw a single texture at a position (with variants NineSliceSprite for resizable UI panels and TilingSprite for repeating backgrounds).pixijs-scene-sprite
Text / BitmapText / HTMLText / SplitText / SplitBitmapTextRender 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
GraphicsVector drawing: shapes, lines, paths, fills, strokes. Backed by a GraphicsContext.pixijs-scene-graphics
Mesh / MeshSimple / MeshPlane / MeshRope / PerspectiveMeshCustom geometry with a shader or texture. Use MeshRope for textured path-following ribbons and PerspectiveMesh for 2D perspective.pixijs-scene-mesh
ParticleContainer + ParticleThousands of lightweight sprites with a restricted transform set, for high-throughput particle effects.pixijs-scene-particle-container
DOMContainerRender an HTML element positioned inside the scene graph (useful for inputs, iframes, accessibility overlays).pixijs-scene-dom-container
GifSpriteAnimated GIF playback as a display object. Requires pixi.js/gif.pixijs-scene-gif

Container itself is covered in pixijs-scene-container and is the node every leaf lives inside.

When to use what (quick decisions)

  • "I want to group and transform some display objects" → Container, see pixijs-scene-container.
  • "I want to draw a texture" → Sprite, see pixijs-scene-sprite.
  • "I want to draw vector shapes or paths" → Graphics, see pixijs-scene-graphics.
  • "I want to draw text" → Text / BitmapText / HTMLText, see pixijs-scene-text.
  • "I want thousands of cheap sprites" → ParticleContainer, see pixijs-scene-particle-container.
  • "I want a custom-geometry mesh or a deformed sprite" → Mesh or one of its variants, see pixijs-scene-mesh.
  • "I want to clip a sub-tree" → set .mask, see references/masking.md.
  • "I want a decoupled render order" → RenderLayer, see references/scene-management.md.
  • "I want GPU-level transforms for a big stable sub-tree" → isRenderGroup: true, see references/scene-management.md.
  • "I want to skip offscreen rendering" → cullable = true + CullerPlugin, see pixijs-performance.

References

  • 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.
  • references/container-hierarchy.md: add/remove/swap children, reparenting with transform preservation, label navigation, destroy sub-trees.
  • references/transforms.md: position, scale, rotation, pivot, origin, skew, toGlobal/toLocal, the three matrices (local/group/world), bounds.
  • references/masking.md: AlphaMask, StencilMask, ScissorMask, ColorMask, inverse masking, cost comparison.
  • references/layers.md: RenderLayer, attach/detach, sorted layers, layer + logical parent split.
  • references/render-groups.md: isRenderGroup, GPU-level transforms, when to use, render-groups vs cacheAsTexture.
  • references/scene-management.md: combined view; render groups, RenderLayer, culling, zIndex sorting, boundsArea.

Common Mistakes

[CRITICAL] Adding children to a leaf display object

Wrong:

ts
const sprite = new Sprite(texture);
sprite.addChild(new Graphics().rect(0, 0, 10, 10).fill(0xff0000));

Correct:

ts
const group = new Container();
group.addChild(new Sprite(texture));
group.addChild(new Graphics().rect(0, 0, 10, 10).fill(0xff0000));

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.

[CRITICAL] Referencing DisplayObject

Wrong:

ts
import { DisplayObject } from "pixi.js"; // no such export in v8
function moveNode(node: DisplayObject) {
  node.x += 1;
}

Correct:

ts
import { Container } from "pixi.js";
function moveNode(node: Container) {
  node.x += 1;
}

DisplayObject was removed in v8. Every display object — including Sprite, Graphics, Text, Mesh — is a Container subclass now. Use Container as the base type.

[HIGH] Forgetting isRenderGroup on large static subtrees

Wrong:

ts
const world = new Container();
for (let i = 0; i < 5000; i++) {
  world.addChild(new Sprite(texture));
}
app.stage.addChild(world);

Correct:

ts
const world = new Container({ isRenderGroup: true });
for (let i = 0; i < 5000; i++) {
  world.addChild(new Sprite(texture));
}
app.stage.addChild(world);

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.

[HIGH] Treating child.x as world space

Wrong:

ts
const enemy = new Container();
enemy.x = 500;
world.addChild(enemy);
world.x = 200;
console.log(enemy.x); // 500 (local), not 700 (world)

Correct:

ts
const worldPos = enemy.toGlobal({ x: 0, y: 0 });
console.log(worldPos.x); // 700

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.

[MEDIUM] sortableChildren without zIndex

Wrong:

ts
const layer = new Container();
layer.sortableChildren = true;
layer.addChild(bg); // no zIndex
layer.addChild(mid); // no zIndex
layer.addChild(fg); // no zIndex
// order is unchanged — all zIndex default to 0

Correct:

ts
const layer = new Container();
layer.sortableChildren = true;
bg.zIndex = 0;
mid.zIndex = 10;
fg.zIndex = 20;
layer.addChild(bg, mid, fg);

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.

Tooling

The PixiJS Devtools Chrome extension lets you inspect and manipulate a running scene graph in real time. Install it for any non-trivial layout or render-order debugging.

API Reference

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Pixijs Scene Core Concepts?

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.

Firwat Pixijs Scene Core Concepts op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Pixijs Scene Core Concepts besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Pixijs Scene Core Concepts an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/pixijs/pixijs-skills/tree/main/skills/pixijs-scene-core-concepts an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Pixijs Scene Core Concepts benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Pixijs Scene Core Concepts benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Pixijs Scene Core Concepts domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Pixijs Scene Core Concepts gratis?

Jo. pixijs huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇