Token导航 LogoToken导航

Agent Skill · 前端设计

pixijs-scene-container(pixjs 场景容器)

pixijs-scene-container 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

pixijs-scene-container 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 1,159。

总安装 7,268周安装 309GitHub Stars 164下载 2,546核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pixijs-scene-container(pixjs 场景容器)
来源仓库:https://github.com/pixijs/pixijs-skills
仓库路径:skills/pixijs-scene-container
安装命令:
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-scene-container
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-scene-container

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合围绕仓库状态、代码变更或协作事项进行整理和分析。通过 npx skills add 命令安装,需结合原始 README 核验具体用法。安装前建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。

pixijs-scene-container 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/pixijs-scene-container

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-scene-cont…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

pixijs-scene-container 怎么安装?

在终端执行 npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-scene-container。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

pixijs-scene-container 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

pixijs-scene-container 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

pixijs-scene-container 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

pixijs-scene-container 用的人多吗?

公开数据是累计安装 7,268 次,近一周安装 309 次,下载 2,546 次,GitHub 164 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

pixijs-scene-container 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
pixijs-scene-container

pixjs 场景容器 · 本页

7,268164需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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.

Assumes familiarity with pixijs-scene-core-concepts.

Quick Start

const group = new Container({
  label: "hero-group",
  x: 200,
  y: 150,
  sortableChildren: true,
});

const body = new Sprite(await Assets.load("body.png"));
const head = new Sprite(await Assets.load("head.png"));
head.position.set(0, -40);
head.zIndex = 1;

group.addChild(body, head);
group.pivot.set(group.width / 2, group.height / 2);
group.scale.set(1.5);

app.stage.addChild(group);

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

Core Patterns

Constructor options

const container = new Container({
  label: "world",
  x: 100,
  y: 50,
  scale: 2,
  rotation: Math.PI / 4,
  alpha: 0.8,
  visible: true,
  tint: 0xffaa00,
  blendMode: "add",
  sortableChildren: true,
  isRenderGroup: true,
  origin: { x: 0, y: 0 },
  boundsArea: new Rectangle(0, 0, 1920, 1080),
});

All Container options (position, scale, tint, label, filters, zIndex, etc.) are also valid here — see skills/pixijs-scene-core-concepts/references/constructor-options.md.

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.

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.

sortableChildren: true causes children to be re-sorted by zIndex at the next render. See zIndex below.

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.

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.

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.

Leaves vs containers

const parent = new Container();
const sprite = new Sprite(texture);

parent.addChild(sprite);

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.

Adding and removing children

const parent = new Container();

parent.addChild(a, b, c);
parent.addChildAt(d, 0);
parent.swapChildren(a, b);
parent.setChildIndex(c, 0);

parent.removeChild(b);
parent.removeChildAt(0);
parent.removeChildren();

parent.removeChildren(0, 2);

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.

removeChildren(beginIndex?, endIndex?) removes a slice and returns the removed array.

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

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.

Transform properties

const obj = new Container();

obj.x = 100;
obj.y = 200;
obj.position.set(100, 200);

obj.scale.set(2);
obj.scale = 2;

obj.rotation = Math.PI / 4;
obj.angle = 45;

obj.pivot.set(50, 50);
obj.skew.set(0.1, 0.2);

obj.alpha = 0.5;
obj.tint = 0xff0000;
obj.visible = false;
obj.renderable = false;
  • position, scale, pivot, skew are ObservablePoints. Assigning scale = 2 is valid and sets both axes.
  • rotation is radians; angle is degrees; they are aliases that stay in sync.
  • pivot sets the point in local space that maps to position in parent space; changing it both moves and rotates the container.
  • alpha and tint multiply down through children. blendMode applies to this container's draw instructions.
  • 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).

zIndex and sortableChildren

const world = new Container({ sortableChildren: true });

const ground = new Sprite(groundTexture);
ground.zIndex = 0;

const player = new Sprite(playerTexture);
player.zIndex = 10;

const ui = new Sprite(uiTexture);
ui.zIndex = 100;

world.addChild(ground, player, ui);

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.

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.

Bounds and coordinate conversion

const bounds = container.getBounds();
console.log(bounds.x, bounds.y, bounds.width, bounds.height);

const rect = container.getBounds().rectangle;

const local = new Point(10, 20);
const world = container.toGlobal(local);
const backToLocal = container.toLocal(world);

const selfPos = container.getGlobalPosition();

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.

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

Sizing

const sprite = new Sprite(texture);

sprite.setSize(200, 100);
const { width, height } = sprite.getSize();

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.

Container events

const parent = new Container();

parent.on("childAdded", (child, container, index) => {
  console.log("added at", index, child.label);
});

parent.on("childRemoved", (child, container, index) => {
  console.log("removed from", index);
});

const child = new Container();
child.on("added", (newParent) => console.log("entered", newParent.label));
child.on("removed", (oldParent) => console.log("left", oldParent.label));
child.on("visibleChanged", (visible) => console.log("visible:", visible));
child.on("destroyed", (destroyed) => console.log("gone", destroyed.label));

parent.addChild(child);
EventFires onArguments
childAddedthe parent receiving the child(child, container, index)
childRemovedthe parent losing the child(child, container, index)
addedthe child that was attached(parent)
removedthe child that was detached(parent)
destroyedthe destroyed container(container)
visibleChangedthe container whose visible flipped(visible)

These are emitted on the EventEmitter side of Container; do not confuse them with pointer events from pixijs-events.

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.

Per-frame updates with onRender

const container = new Container();

container.onRender = (renderer) => {
  container.rotation += 0.01;
};

container.onRender = null;

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.

Finding and removing from parent

const player = world.getChildByLabel("player");
const enemies = world.getChildrenByLabel(/enemy-\d+/, true);

const bounds = hud.getLocalBounds();

oldSprite.removeFromParent();
  • getChildByLabel(label, deep?) — first match by string or RegExp. Pass true for a recursive search.
  • getChildrenByLabel(label, deep?, out?) — all matches. Accepts an optional reusable output array.
  • getLocalBounds() — bounds in this container's own coordinate space, ignoring parent transforms. Cheaper than getBounds() for self-contained layout math.
  • removeFromParent() — detaches this from its current parent (no-op if already orphaned).

Destroy

container.destroy();

container.destroy({
  children: true,
  texture: true,
  textureSource: true,
});

console.log(container.destroyed);

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.

Common Mistakes

[CRITICAL] Adding children to leaf scene objects

Wrong:

const sprite = new Sprite(texture);
const overlay = new Sprite(overlayTexture);
sprite.addChild(overlay);

Correct:

const group = new Container();
const sprite = new Sprite(texture);
const overlay = new Sprite(overlayTexture);
group.addChild(sprite, overlay);

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.

[HIGH] Expecting getBounds() to return a Rectangle

Wrong:

const rect = container.getBounds();
rect.contains(x, y); // TypeError: contains is not a function

Correct:

const rect = container.getBounds().rectangle;
rect.contains(x, y);

const bounds = container.getBounds();
console.log(bounds.width, bounds.height);

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.

[HIGH] Using cacheAsBitmap instead of cacheAsTexture

Wrong:

container.cacheAsBitmap = true;

Correct:

container.cacheAsTexture(true);

cacheAsBitmap (v7 property) was renamed to cacheAsTexture() (a method) in v8. Always disable it with cacheAsTexture(false) before calling destroy().

[MEDIUM] Using container.name instead of container.label

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.

[MEDIUM] Setting both pivot and origin on the same container

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.

API Reference

平台分布

Codex

35.13%
按下载量换算894

Claude

33.34%
按下载量换算849

Cursor

18.75%
按下载量换算477

Gemini CLI

10.02%
按下载量换算255

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills