Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

pixijs-migration-v8pixijs 迁移 v8

Agent Skill

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

总安装

6,168

周安装

257

GitHub Stars

164

下载量

2,056
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/pixijs/pixijs-skills --skill pixijs-migration-v8

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理和分析。
  • 通过 npx skills add 命令安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态,避免触发不必要的联网或文件操作。
  • pixijs-migration-v8 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

This skill is a breaking-change checklist for bringing a v7 codebase up to v8. Work top-down through the categories; the list maps each v7 pattern to its v8 replacement.

Quick Start

Install the single package, then port in this order: imports → Application init → Graphics → Text → events → shaders/filters → cleanup.

const app = new Application();
await app.init({ width: 800, height: 600 });
document.body.appendChild(app.canvas);

const g = new Graphics()
  .rect(0, 0, 100, 100)
  .fill({ color: 0xff0000 })
  .stroke({ width: 2, color: 0x000000 });
app.stage.addChild(g);

Related skills: pixijs-application (async init), pixijs-scene-graphics (new fill/stroke API), pixijs-custom-rendering (shader rework), pixijs-scene-text (Text constructor changes), pixijs-performance (destroy patterns).

Migration Checklist: v7 to v8

Work through each category. Each item shows the expected v8 pattern and the v7 pattern that must be replaced.

Initialization

Async app.init() -- Expected:

const app = new Application();
await app.init({ width: 800, height: 600 });
document.body.appendChild(app.canvas);

Fail: passing options to new Application({...}) and using synchronously.

app.canvas replaces app.view -- app.view emits a deprecation warning.

Application type parameter -- Expected: new Application<Renderer<HTMLCanvasElement>>(). Fail: new Application<HTMLCanvasElement>().

Imports

Single package -- Expected:

import { Sprite, Application, Assets, Graphics } from "pixi.js";

Fail: importing from any of the deprecated v7 core @pixi/* sub-packages (see list below). Supplemental packages like @pixi/sound are still valid and should continue to be used.

Deprecated @pixi/* packages (never use, any version): @pixi/accessibility, @pixi/app, @pixi/assets, @pixi/compressed-textures, @pixi/core, @pixi/display, @pixi/events, @pixi/extensions, @pixi/extract, @pixi/filter-alpha, @pixi/filter-blur, @pixi/filter-color-matrix, @pixi/filter-displacement, @pixi/filter-fxaa, @pixi/filter-noise, @pixi/graphics, @pixi/mesh, @pixi/mesh-extras, @pixi/mixin-cache-as-bitmap, @pixi/mixin-get-child-by-name, @pixi/mixin-get-global-position, @pixi/particle-container, @pixi/prepare, @pixi/sprite, @pixi/sprite-animated, @pixi/sprite-tiling, @pixi/spritesheet, @pixi/text, @pixi/text-bitmap, @pixi/text-html.

Custom builds -- Set skipExtensionImports: true and import only needed extensions:

import "pixi.js/graphics";
import "pixi.js/text";
import "pixi.js/events";
import { Application } from "pixi.js";
await app.init({ skipExtensionImports: true });

Note: manageImports: false is still accepted but @deprecated since 8.1.6; prefer skipExtensionImports: true.

Extensions not auto-imported (require explicit import even with default auto-imports enabled): pixi.js/advanced-blend-modes, pixi.js/unsafe-eval, pixi.js/prepare, pixi.js/math-extras, pixi.js/dds, pixi.js/ktx, pixi.js/ktx2, pixi.js/basis.

Community filters -- Expected: import {AdjustmentFilter} from 'pixi-filters/adjustment'. Fail: @pixi/filter-adjustment.

Graphics API

Shape-then-fill -- Expected:

const g = new Graphics().rect(50, 50, 100, 100).fill(0xff0000);

Fail: beginFill(0xff0000).drawRect(50, 50, 100, 100).endFill().

Renamed shape methods:

v7v8
drawRectrect
drawCirclecircle
drawEllipseellipse
drawPolygonpoly
drawRoundedRectroundRect
drawStarstar
drawRegularPolygonregularPoly
drawRoundedPolygonroundPoly
drawRoundedShaperoundShape
drawChamferRectchamferRect
drawFilletRectfilletRect

Fill replaces beginFill/beginTextureFill -- Expected:

graphics
  .rect(0, 0, 100, 100)
  .fill({ texture: Texture.WHITE, alpha: 0.5, color: 0xff0000 });

Fail: beginFill(color, alpha) or beginTextureFill({texture, alpha, color}).

Stroke replaces lineStyle -- Expected:

graphics.rect(0, 0, 100, 100).fill("blue").stroke({ width: 2, color: "white" });

Fail: lineStyle(2, 'white') or lineTextureStyle({texture, width, color}).

Holes use cut() -- Expected:

graphics.rect(0, 0, 100, 100).fill(0x00ff00).circle(50, 50, 20).cut();

Fail: beginHole() / endHole().

GraphicsContext replaces GraphicsGeometry -- Expected:

const context = new GraphicsContext().rect(0, 0, 100, 100).fill(0xff0000);
const g1 = new Graphics(context);
const g2 = new Graphics(context);

Fail: new Graphics(graphics.geometry).

Text

Options object constructor -- Expected:

const text = new Text({ text: "Hello", style: { fontSize: 24 } });
const bmp = new BitmapText({ text: "Hello", style: { fontFamily: "MyFont" } });
const html = new HTMLText({ text: "<b>Hello</b>", style: { fontSize: 24 } });

Fail: new Text('Hello', {fontSize: 24}) (positional args).

Bitmap font loading -- Must import 'pixi.js/text-bitmap' before Assets.load('font.fnt').

Sprites / Mesh

Texture.from no longer loads URLs -- Must call await Assets.load('image.png') first, then Texture.from('image.png').

NineSliceSprite replaces NineSlicePlane -- Expected:

const ns = new NineSliceSprite({
  texture,
  leftWidth: 10,
  topHeight: 10,
  rightWidth: 10,
  bottomHeight: 10,
});

Mesh renames: SimpleMesh -> MeshSimple, SimplePlane -> MeshPlane, SimpleRope -> MeshRope. All use options objects.

MeshGeometry options -- Expected:

const geom = new MeshGeometry({
  positions: vertices,
  uvs,
  indices,
  topology: "triangle-list",
});

Fail: new MeshGeometry(vertices, uvs, indices).

ParticleContainer uses Particle -- Expected:

const container = new ParticleContainer({
  boundsArea: new Rectangle(0, 0, 800, 600),
});
const particle = new Particle(texture);
container.addParticle(particle);

Fail: container.addChild(new Sprite(texture)).

Events

eventMode replaces interactive -- Expected:

sprite.eventMode = "static";
sprite.cursor = "pointer";
sprite.on("pointertap", () => {
  /* handle */
});

Legacy: sprite.interactive = true; (still works as an alias for eventMode = 'static', but prefer the explicit form).

Default eventMode is 'passive' (no events). Must set 'static' or 'dynamic' explicitly.

Ticker callback -- Expected:

app.ticker.add((ticker) => {
  bunny.rotation += ticker.deltaTime;
});

Broken: app.ticker.add((dt) => {bunny.rotation += dt;}) -- compiles but dt is a Ticker object, not a number. Coerces to NaN, silently corrupting rotation.

updateTransform removed -- Use this.onRender = this._onRender.bind(this) in constructor instead.

Shaders

Shader.from uses options -- Expected:

const shader = Shader.from({
  gl: { vertex: vertexSrc, fragment: fragmentSrc },
  resources: {
    myUniforms: new UniformGroup({ uTime: { value: 0, type: "f32" } }),
  },
});

Fail: Shader.from(vertex, fragment, uniforms).

Filter constructor -- Expected:

const filter = new Filter({
  glProgram: GlProgram.from({ fragment, vertex }),
  resources: { filterUniforms: { uTime: { value: 0, type: "f32" } } },
});

Fail: new Filter(vertex, fragment, {uTime: 0}).

Uniforms require type -- new UniformGroup({uTime: {value: 1, type: 'f32'}}). Fail: new UniformGroup({uTime: 1}).

Textures are resources, not uniforms -- Pass as top-level resource entries (texture.source, texture.style), not inside UniformGroup.

Textures

Sprite no longer auto-detects texture UV changes -- If you modify a texture's frame after creation, call texture.update() to recalculate UVs, then call sprite.onViewUpdate() to refresh the sprite. Both calls are required in this order. Updating source data (e.g. video textures) is still automatic.

texture.frame.width = texture.frame.width / 2;
texture.update(); // recalculate texture UVs first
sprite.onViewUpdate(); // then refresh the sprite's display

Mipmaps -- BaseTexture.mipmap renamed to autoGenerateMipmaps. For RenderTextures, you must manually update mipmaps:

const rt = RenderTexture.create({
  width: 100,
  height: 100,
  autoGenerateMipmaps: true,
});
renderer.render({ target: rt, container: scene });
rt.source.updateMipmaps();

Adapters

DOMAdapter replaces settings.ADAPTER -- Expected:

import { DOMAdapter, WebWorkerAdapter } from "pixi.js";
DOMAdapter.set(WebWorkerAdapter);
DOMAdapter.get().createCanvas();

Fail: settings.ADAPTER = WebWorkerAdapter; settings.ADAPTER.createCanvas();.

Built-in adapters: BrowserAdapter (default), WebWorkerAdapter (for web workers).

Other

DisplayObject removed -- Container is the base class. class MyObj extends DisplayObject fails.

Leaf nodes cannot have children -- Sprite, Graphics, Mesh, Text are leaf nodes. Wrap in Container.

Renamed properties (old names still exist as deprecated aliases with warnings):

  • container.name -> container.label
  • container.cacheAsBitmap = true -> container.cacheAsTexture(true)

getBounds() return type changed: getBounds() now returns a Bounds object, not a Rectangle. Bounds has .x, .y, .width, .height getters, so basic usage works. Use .rectangle when you need a Rectangle instance (e.g., for .contains()).

settings object removed -- Use AbstractRenderer.defaultOptions.resolution = 1 and DOMAdapter.set(BrowserAdapter).

utils namespace removed -- import {isMobile} from 'pixi.js' instead of utils.isMobile.

Text parser renames:

  • TextFormat -> bitmapFontTextParser
  • XMLStringFormat -> bitmapFontXMLStringParser
  • XMLFormat -> bitmapFontXMLParser

Assets.add -- Assets.add({alias: 'bunny', src: 'bunny.png'}). Fail: Assets.add('bunny', 'bunny.png').

Enum constants replaced with strings:

v7v8
SCALE_MODES.NEAREST'nearest'
SCALE_MODES.LINEAR'linear'
WRAP_MODES.CLAMP'clamp-to-edge'
WRAP_MODES.REPEAT'repeat'
WRAP_MODES.MIRRORED_REPEAT'mirror-repeat'
DRAW_MODES.TRIANGLES'triangle-list'
DRAW_MODES.TRIANGLE_STRIP'triangle-strip'
DRAW_MODES.LINES'line-list'
DRAW_MODES.LINE_STRIP'line-strip'
DRAW_MODES.POINTS'point-list'

Culling is manual -- Set cullable = true, then call Culler.shared.cull(container, viewRect) before render. Or add CullerPlugin via extensions.add(CullerPlugin).

Pre-Migration Summary

  • No deprecated v7 core @pixi/* packages in dependencies (supplemental packages like @pixi/sound are fine)
  • All core @pixi/* imports converted to pixi.js
  • All new Application({...}) converted to await app.init({...})
  • All Graphics code uses shape-then-fill pattern
  • All constructors use options objects (Text, Mesh, NineSliceSprite, etc.)
  • Shader/Filter code uses {gl, resources} pattern with typed uniforms
  • ParticleContainer code uses Particle, not Sprite
  • Ticker callbacks access ticker.deltaTime, not first param as delta
  • Event handling uses eventMode instead of interactive
  • settings and utils references removed
  • DisplayObject references replaced with Container
  • Texture UV modifications call sprite.onViewUpdate() where needed
  • RenderTexture mipmap code calls source.updateMipmaps() manually
  • settings.ADAPTER replaced with DOMAdapter.set()

Common Mistakes

[CRITICAL] Importing from deprecated v7 core @pixi/* sub-packages

Wrong:

import { Sprite } from "@pixi/sprite";
import { Application } from "@pixi/app";

Correct:

import { Sprite, Application } from "pixi.js";

v8 uses a single pixi.js package. The v7 core @pixi/* sub-packages are deprecated and must not be used (see the full list under Imports above). Supplemental packages like @pixi/sound are still valid.

[CRITICAL] Using DisplayObject as base class

Wrong: class MyObject extends DisplayObject {...} Correct: class MyObject extends Container {...}

DisplayObject was removed in v8. Container is the base class for all display objects.

[HIGH] Using old SCALE_MODES/WRAP_MODES/DRAW_MODES enums

Wrong: texture.source.scaleMode = SCALE_MODES.NEAREST; Correct: texture.source.scaleMode = 'nearest';

v8 uses string values. Old enums may work as deprecated aliases but should be replaced.

[HIGH] Using interactive = true instead of eventMode

Legacy: sprite.interactive = true; (still works as an alias for eventMode = 'static') Preferred: sprite.eventMode = 'static';

Default eventMode is 'passive' (no events). Must set 'static' (hit-testable, no tick checks) or 'dynamic' (hit-testable with tick checks) explicitly. interactive = true still works without a deprecation warning, but eventMode is the canonical v8 API.

[HIGH] Using utils namespace

Wrong: import {utils} from 'pixi.js'; utils.isMobile.any(); Correct: import {isMobile} from 'pixi.js'; isMobile.any();

The utils namespace was removed. All utility functions are direct imports.

[HIGH] Expecting texture UV changes to auto-update sprites

Wrong: modifying texture.frame and assuming the sprite updates automatically. Correct: call sprite.onViewUpdate() after modifying texture UVs.

Sprites no longer subscribe to texture UV change events for performance. Source data updates (e.g. video) still auto-reflect.

API Reference

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.51%
按下载量换算792

Claude

29.88%
按下载量换算614

Cursor

17.26%
按下载量换算355

Gemini CLI

9.91%
按下载量换算204

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills