jpskill.com
🎨 デザイン コミュニティ

pixijs

PixiJSのエキスパートとして、WebGLとCanvasを使い分け、スプライトやテキスト、フィルタなどを活用して、ゲームやインタラクティブな表現、UI効果などを高速に実現するSkill。

📜 元の英語説明(参考)

You are an expert in PixiJS, the fastest 2D rendering engine for the web. You help developers build games, interactive visualizations, animated ads, creative coding projects, and rich UI effects using PixiJS's WebGL-first renderer with automatic Canvas fallback — handling sprites, text, filters, masks, blend modes, and custom shaders at 60fps with hundreds of thousands of objects.

🇯🇵 日本人クリエイター向け解説

一言でいうと

PixiJSのエキスパートとして、WebGLとCanvasを使い分け、スプライトやテキスト、フィルタなどを活用して、ゲームやインタラクティブな表現、UI効果などを高速に実現するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o pixijs.zip https://jpskill.com/download/15259.zip && unzip -o pixijs.zip && rm pixijs.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15259.zip -OutFile "$d\pixijs.zip"; Expand-Archive "$d\pixijs.zip" -DestinationPath $d -Force; ri "$d\pixijs.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して pixijs.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → pixijs フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

PixiJS — 高パフォーマンスな2D WebGLレンダラー

あなたは、ウェブ上で最速の2DレンダリングエンジンであるPixiJSのエキスパートです。PixiJSのWebGLファーストのレンダラーと自動Canvasフォールバックを使用して、開発者がゲーム、インタラクティブな視覚化、アニメーション広告、クリエイティブコーディングプロジェクト、およびリッチなUIエフェクトを構築するのを支援します。スプライト、テキスト、フィルター、マスク、ブレンドモード、およびカスタムシェーダーを、数十万のオブジェクトで60fpsで処理します。

主要な機能

アプリケーションのセットアップ

// src/main.ts — PixiJS 8 アプリケーション
import { Application, Sprite, Text, Container, Assets } from "pixi.js";

const app = new Application();
await app.init({
  width: 800,
  height: 600,
  backgroundColor: 0x1a1a2e,
  antialias: false,                       // シャープなピクセルアート
  resolution: window.devicePixelRatio,    // Retinaサポート
});
document.body.appendChild(app.canvas);

// アセットのロード
await Assets.load([
  { alias: "hero", src: "/sprites/hero.png" },
  { alias: "tileset", src: "/sprites/tileset.png" },
  { alias: "particle", src: "/sprites/particle.png" },
]);

// スプライトの作成
const hero = Sprite.from("hero");
hero.anchor.set(0.5);                    // 回転の中心アンカー
hero.position.set(400, 300);
app.stage.addChild(hero);

// ゲームループ
app.ticker.add((ticker) => {
  hero.rotation += 0.01 * ticker.deltaTime;
});

コンテナとシーングラフ

// 階層的なシーングラフ
const world = new Container();
const uiLayer = new Container();
const particleLayer = new Container();

app.stage.addChild(world);
app.stage.addChild(particleLayer);
app.stage.addChild(uiLayer);            // UIは常に最前面

// 子をY座標でソート (トップダウンゲームの深度ソート)
world.sortableChildren = true;
entities.forEach((entity) => {
  entity.zIndex = entity.y;
});

フィルターとシェーダー

import { BlurFilter, ColorMatrixFilter, DisplacementFilter } from "pixi.js";

// 組み込みフィルター
const blur = new BlurFilter({ strength: 4 });
const grayscale = new ColorMatrixFilter();
grayscale.desaturate();

background.filters = [blur];              // 被写界深度エフェクト
deadEnemy.filters = [grayscale];          // 死亡時に彩度を下げる

// 水/熱エフェクトのディスプレイスメントマップ
const displacementSprite = Sprite.from("displacement-map");
displacementSprite.texture.source.addressMode = "repeat";
const displacement = new DisplacementFilter({
  sprite: displacementSprite,
  scale: 20,
});
waterLayer.filters = [displacement];

// 流れる水のためにディスプレイスメントをアニメーション化
app.ticker.add((ticker) => {
  displacementSprite.x += 0.5 * ticker.deltaTime;
  displacementSprite.y += 0.3 * ticker.deltaTime;
});

スプライトシートアニメーション

import { AnimatedSprite, Spritesheet, Assets } from "pixi.js";

// スプライトシートのロード
const sheet = await Assets.load("/sprites/hero.json");

// アニメーションスプライトの作成
const heroAnim = new AnimatedSprite(sheet.animations["walk"]);
heroAnim.animationSpeed = 0.15;
heroAnim.play();
app.stage.addChild(heroAnim);

// アニメーションの切り替え
function setAnimation(name: string) {
  heroAnim.textures = sheet.animations[name];
  heroAnim.play();
}
// setAnimation("idle"), setAnimation("attack"), setAnimation("die")

テキストとグラフィックス

import { Text, TextStyle, Graphics } from "pixi.js";

// スタイル付きテキスト
const style = new TextStyle({
  fontFamily: "Press Start 2P",          // ピクセルフォント
  fontSize: 24,
  fill: ["#ffffff", "#00ff88"],          // グラデーション塗りつぶし
  stroke: { color: "#000000", width: 4 },
  dropShadow: { color: "#000000", distance: 2 },
});
const scoreText = new Text({ text: "Score: 0", style });

// プロシージャルグラフィックス
const healthBar = new Graphics();
healthBar.rect(0, 0, 200, 20).fill(0x333333);  // 背景
healthBar.rect(2, 2, 196 * hp, 16).fill(0x00ff00);  // 塗りつぶし

// ミニマップ
const minimap = new Graphics();
minimap.circle(playerX / 10, playerY / 10, 3).fill(0x00ff00);
rooms.forEach(r => minimap.rect(r.x / 10, r.y / 10, r.w / 10, r.h / 10).stroke(0x666666));

インストール

npm install pixi.js
# PixiJS 8 (最新): WebGPU + WebGL, tree-shakeable

ベストプラクティス

  1. レイヤーにコンテナを使用する — world、UI、particles、debugをコンテナに分離する。深度ソートのためにsortableChildrenを設定する
  2. スプライトバッチ処理 — 同じテクスチャアトラスを使用するスプライトは自動的にバッチ処理される。アトラスを4096×4096未満に保つ
  3. オブジェクトプーリング — スプライトを事前に作成して再利用する。PixiJSの割り当ては高速だが、GCの一時停止はそうではない
  4. ParticleContainer — 数千の単純なスプライト(フィルターなし、子なし)にはParticleContainerを使用する。Containerより10倍高速
  5. フィルターは控えめに — 各フィルターはレンダーテクスチャパスをトリガーする。スプライトごとではなく、大きなコンテナに1〜2個のフィルターを使用する
  6. アセットのロード — エイリアス付きのAssets.loadを使用する。スプライトシート、ビットマップフォント、JSON、およびオーディオをサポートする
  7. 解像度 — Retinaスクリーンでシャープなレンダリングを行うためにresolution: devicePixelRatioを設定する
  8. 適切に破棄する — GPUテクスチャを解放するためにsprite.destroy(true)を呼び出す。長期実行アプリでのメモリリークを防ぐ
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

PixiJS — High-Performance 2D WebGL Renderer

You are an expert in PixiJS, the fastest 2D rendering engine for the web. You help developers build games, interactive visualizations, animated ads, creative coding projects, and rich UI effects using PixiJS's WebGL-first renderer with automatic Canvas fallback — handling sprites, text, filters, masks, blend modes, and custom shaders at 60fps with hundreds of thousands of objects.

Core Capabilities

Application Setup

// src/main.ts — PixiJS 8 application
import { Application, Sprite, Text, Container, Assets } from "pixi.js";

const app = new Application();
await app.init({
  width: 800,
  height: 600,
  backgroundColor: 0x1a1a2e,
  antialias: false,                       // Crisp pixel art
  resolution: window.devicePixelRatio,    // Retina support
});
document.body.appendChild(app.canvas);

// Load assets
await Assets.load([
  { alias: "hero", src: "/sprites/hero.png" },
  { alias: "tileset", src: "/sprites/tileset.png" },
  { alias: "particle", src: "/sprites/particle.png" },
]);

// Create sprite
const hero = Sprite.from("hero");
hero.anchor.set(0.5);                    // Center anchor for rotation
hero.position.set(400, 300);
app.stage.addChild(hero);

// Game loop
app.ticker.add((ticker) => {
  hero.rotation += 0.01 * ticker.deltaTime;
});

Containers and Scene Graph

// Hierarchical scene graph
const world = new Container();
const uiLayer = new Container();
const particleLayer = new Container();

app.stage.addChild(world);
app.stage.addChild(particleLayer);
app.stage.addChild(uiLayer);            // UI always on top

// Sort children by Y position (depth sorting for top-down games)
world.sortableChildren = true;
entities.forEach((entity) => {
  entity.zIndex = entity.y;
});

Filters and Shaders

import { BlurFilter, ColorMatrixFilter, DisplacementFilter } from "pixi.js";

// Built-in filters
const blur = new BlurFilter({ strength: 4 });
const grayscale = new ColorMatrixFilter();
grayscale.desaturate();

background.filters = [blur];              // Depth-of-field effect
deadEnemy.filters = [grayscale];          // Desaturate on death

// Displacement map for water/heat effects
const displacementSprite = Sprite.from("displacement-map");
displacementSprite.texture.source.addressMode = "repeat";
const displacement = new DisplacementFilter({
  sprite: displacementSprite,
  scale: 20,
});
waterLayer.filters = [displacement];

// Animate displacement for flowing water
app.ticker.add((ticker) => {
  displacementSprite.x += 0.5 * ticker.deltaTime;
  displacementSprite.y += 0.3 * ticker.deltaTime;
});

Spritesheet Animation

import { AnimatedSprite, Spritesheet, Assets } from "pixi.js";

// Load spritesheet
const sheet = await Assets.load("/sprites/hero.json");

// Create animated sprite
const heroAnim = new AnimatedSprite(sheet.animations["walk"]);
heroAnim.animationSpeed = 0.15;
heroAnim.play();
app.stage.addChild(heroAnim);

// Switch animations
function setAnimation(name: string) {
  heroAnim.textures = sheet.animations[name];
  heroAnim.play();
}
// setAnimation("idle"), setAnimation("attack"), setAnimation("die")

Text and Graphics

import { Text, TextStyle, Graphics } from "pixi.js";

// Styled text
const style = new TextStyle({
  fontFamily: "Press Start 2P",          // Pixel font
  fontSize: 24,
  fill: ["#ffffff", "#00ff88"],          // Gradient fill
  stroke: { color: "#000000", width: 4 },
  dropShadow: { color: "#000000", distance: 2 },
});
const scoreText = new Text({ text: "Score: 0", style });

// Procedural graphics
const healthBar = new Graphics();
healthBar.rect(0, 0, 200, 20).fill(0x333333);  // Background
healthBar.rect(2, 2, 196 * hp, 16).fill(0x00ff00);  // Fill

// Minimap
const minimap = new Graphics();
minimap.circle(playerX / 10, playerY / 10, 3).fill(0x00ff00);
rooms.forEach(r => minimap.rect(r.x / 10, r.y / 10, r.w / 10, r.h / 10).stroke(0x666666));

Installation

npm install pixi.js
# PixiJS 8 (latest): WebGPU + WebGL, tree-shakeable

Best Practices

  1. Use containers for layers — Separate world, UI, particles, debug into containers; set sortableChildren for depth sorting
  2. Sprite batching — Sprites using the same texture atlas are batched automatically; keep atlases under 4096×4096
  3. Object pooling — Pre-create sprites and reuse them; PixiJS allocation is fast but GC pauses are not
  4. ParticleContainer — Use ParticleContainer for thousands of simple sprites (no filters, no children); 10x faster than Container
  5. Filters sparingly — Each filter triggers a render texture pass; use 1-2 filters on large containers, not per-sprite
  6. Asset loading — Use Assets.load with aliases; supports spritesheets, bitmap fonts, JSON, and audio
  7. Resolution — Set resolution: devicePixelRatio for sharp rendering on retina screens
  8. Destroy properly — Call sprite.destroy(true) to free GPU texture; prevents memory leaks in long-running apps