Skip to main content
skill CX Codex

pixijs-scene-text — Claude Code skill: what it does, how to install

Teaches coding agents to render text in PixiJS v8 properly. Helps pick between bitmap, HTML, and canvas rendering without stalling frame updates.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add pixijs/pixijs-skills --skill pixijs-scene-text -a claude-code
Open on GitHub

What pixijs-scene-text does

PixiJS v8 provides five text classes tailored for specific performance needs. Text renders sharp labels to a canvas, while BitmapText draws from a glyph atlas for cheap updates. HTMLText handles formatted markup through SVG. For character animations, SplitText and SplitBitmapText expose per-glyph containers.

Text objects are leaf nodes and cannot hold child elements directly. Grouping multiple labels requires placing them inside a Container instead.

Constructors in v8 no longer accept positional arguments. Passing a raw string and a style object will break because options objects are now mandatory. Frequent updates to dynamic strings will stall rendering if you use Text instead of BitmapText due to repeated canvas rasterization.

What it helps with

  • select the optimal text class for PixiJS v8 scenes
  • animate individual characters with SplitText
  • render styled markup using HTMLText
  • prevent GPU stalls by moving dynamic counters to BitmapText

Example prompts for the agent

  • Refactor this timer to BitmapText in PixiJS v8
  • Set up SplitText for a character-by-character headline animation
  • Create an HTMLText node with inline styles

How to install pixijs-scene-text

1Skills CLI (Vercel)

npx skills add pixijs/pixijs-skills --skill pixijs-scene-text -a claude-code

2Manually: put the files in place

~/.claude/skills/pixijs-scene-text/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/pixijs-scene-text/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about pixijs-scene-text

How to install pixijs-scene-text in Claude Code?

Run npx skills add pixijs/pixijs-skills --skill pixijs-scene-text -a claude-code.

What does pixijs-scene-text do?

It guides agents on text rendering in PixiJS v8. It details differences between Text, BitmapText, HTMLText, and split variants.

Why does positional constructor syntax fail?

PixiJS v8 removed the (string, style) signature. All text classes now require an options object.

Source text

SKILL.md · MIT
---
name: pixijs-scene-text
description: "Use this skill when rendering text in PixiJS v8. Covers Text for canvas-quality styled labels, BitmapText for cheap per-frame updates via glyph atlas, HTMLText for HTML/CSS markup via SVG, SplitText and SplitBitmapText for per-character animation, TextStyle, tagStyles, constructor options, TextOptions, HTMLTextOptions, BitmapText, SplitTextOptions, SplitBitmapTextOptions. Triggers on: Text, BitmapText, HTMLText, SplitText, SplitBitmapText, TextStyle, HTMLTextStyle, BitmapFont.install, tagStyles, fontFamily, wordWrap."
license: MIT
---

PixiJS has five text-rendering classes that cover different trade-offs between styling, performance, and animation. `Text` renders to a canvas for full CSS-style fidelity. `BitmapText` reads from a pre-generated atlas for cheap updates. `HTMLText` renders an HTML fragment via SVG `<foreignObject>` for rich markup. `SplitText` and `SplitBitmapText` wrap the first two classes and expose per-character, per-word, and per-line containers for animation.

Assumes familiarity with `pixijs-scene-core-concepts`. All text classes are leaf nodes; they cannot have children. Wrap multiple text instances in a `Container` to group them.

## Quick Start

```ts
const text = new Text({
  text: "Hello PixiJS",
  style: {
    fontFamily: "Arial",
    fontSize: 36,
    fill: 0xffffff,
    stroke: { color: 0x4a1850, width: 5 },
    dropShadow: { color: 0x000000, blur: 4, distance: 6 },
  },
});

text.anchor.set(0.5);
text.x = app.screen.width / 2;
text.y = 40;

app.stage.addChild(text);
```

All text classes use options-object constructors; positional `(string, style)` from v7 is not supported.

**Related skills:** `pixijs-scene-core-concepts` (leaves, transforms), `pixijs-assets` (font loading), `pixijs-performance` (BitmapText tradeoffs), `pixijs-color` (`FillInput` for fill/stroke), `pixijs-scene-graphics` (gradients and patterns reused via `FillInput`).

## Variants

| Variant           | Use when                                                           | Trade-offs                                                            | Reference                                                          |
| ----------------- | ------------------------------------------------------------------ | --------------------------------------------------------------------- | ------------------------------------------------------------------ |
| `Text`            | High-quality static or infrequent-update labels                    | Expensive to update (canvas re-draw + GPU upload)                     | [references/text.md](references/text.md)                           |
| `BitmapText`      | Scores, timers, gameplay labels, anything that changes every frame | Limited styling; fixed glyph atlas; requires MSDF for crisp scaling   | [references/bitmap-text.md](references/bitmap-text.md)             |
| `HTMLText`        | Rich formatted text, mixed styles, real HTML tags                  | Async rendering (one frame delay); similar update cost to `Text`      | [references/html-text.md](references/html-text.md)                 |
| `SplitText`       | Per-character animation with rich styling                          | Each char is a full `Text`; expensive for long strings                | [references/split-text.md](references/split-text.md)               |
| `SplitBitmapText` | Per-character animation on long strings or dynamic content         | Inherits BitmapText limitations (glyph atlas, no MSDF-free crispness) | [references/split-bitmap-text.md](references/split-bitmap-text.md) |

## When to use what

- **"I need a styled static label"** → `Text`. Use for titles, menus, dialog, error messages. See `references/text.md`.
- **"I need a score or timer that updates every frame"** → `BitmapText`. Updates only reposition quads; no canvas re-draw. See `references/bitmap-text.md`.
- **"I need mixed formatting with `<b>`, `<i>`, `<br>`"** → `HTMLText`. Real HTML/CSS rendering via SVG. See `references/html-text.md`.
- **"I need inline colored tags like `<red>Warning:</red>`"** → `Text` or `HTMLText` with `tagStyles`. Both support it.
- **"I need to animate each character individually"** → `SplitText` for short strings, `SplitBitmapText` for long strings or many instances. See `references/split-text.md` / `references/split-bitmap-text.md`.
- **"I need CJK / Arabic / emoji-heavy text"** → `Text` or `HTMLText`. `BitmapText` fails because the glyph set is too large for a single atlas.
- **"I need a custom font"** → Load via `Assets.load({ src: 'font.woff2', data: { family: 'MyFont' } })` first, then set `style.fontFamily: 'MyFont'`. Works for `Text` and `HTMLText`.

## Update cost comparison

| Update trigger      | Text | BitmapText | HTMLText | SplitText                     | SplitBitmapText          |
| ------------------- | ---- | ---------- | -------- | ----------------------------- | ------------------------ |
| Changing `.text`    | High | Very low   | High     | Very high (N text re-renders) | Low (N quad repositions) |
| Changing `.style`   | High | Medium     | High     | Very high                     | Medium                   |
| Moving (`.x`, `.y`) | Free | Free       | Free     | Free                          | Free                     |
| Rotating / scaling  | Free | Free       | Free     | Free                          | Free                     |

"Free" = normal Container transform cost. "High" = new canvas draw + GPU upload. "Very low" = quad reposition only. Update strings that change per-frame only on `BitmapText` or `SplitBitmapText`.

## Quick concepts

- **Options-object constructors.** Every v8 text class uses `new Text({ text, style, ... })`. The v7 `(string, style)` form is removed.
- **`tagStyles`.** `Text` and `HTMLText` support per-tag styling via `style.tagStyles`. Tags are only parsed when `tagStyles` has entries; otherwise `<` is treated literally.
- **`BitmapFont.install`.** Pre-generates an atlas before you create any `BitmapText`. Without install, the first `BitmapText` with a new `fontFamily` generates the atlas lazily.
- **MSDF fonts.** Multi-channel Signed Distance Field fonts stay sharp at any size. Generate with external tools (e.g., msdf-bmfont), load via `Assets.load('font.fnt')`. Requires `import 'pixi.js/text-bitmap'` in custom builds.

## Common Mistakes

### [HIGH] Updating `Text.text` every frame

Wrong:

```ts
app.ticker.add(() => {
  scoreText.text = `Score: ${score}`;
});
```

Correct:

```ts
const scoreText = new BitmapText({ text: "Score: 0", style });
app.ticker.add(() => {
  scoreText.text = `Score: ${score}`;
});
```

Every `Text` update re-rasterizes the whole string. Use `BitmapText` for any value that changes per-frame.


### [HIGH] Positional constructor args

Wrong:

```ts
const text = new Text("Hello", { fontSize: 24 });
```

Correct:

```ts
const text = new Text({ text: "Hello", style: { fontSize: 24 } });
```

v8 removed the `(string, style)` form. All text classes use options objects.


### [HIGH] Not importing `pixi.js/text-bitmap` in custom builds

Under `skipExtensionImports: true` or aggressive tree-shaking, `Assets.load('font.fnt')` silently returns raw data unless you add `import 'pixi.js/text-bitmap'`. The standard `import { ... } from 'pixi.js'` bundle includes the extension.


### [MEDIUM] Adding children to a text instance

Every text class sets `allowChildren = false`. Wrap in a `Container` to group text with other content.


## API Reference

- [Text](https://pixijs.download/release/docs/scene.Text.html.md)
- [TextStyle](https://pixijs.download/release/docs/text.TextStyle.html.md)
- [BitmapText](https://pixijs.download/release/docs/scene.BitmapText.html.md)
- [BitmapFont](https://pixijs.download/release/docs/text.BitmapFont.html.md)
- [HTMLText](https://pixijs.download/release/docs/scene.HTMLText.html.md)
- [HTMLTextStyle](https://pixijs.download/release/docs/text.HTMLTextStyle.html.md)
- [SplitText](https://pixijs.download/release/docs/text.SplitText.html.md)
- [SplitBitmapText](https://pixijs.download/release/docs/text.SplitBitmapText.html.md)
- [AbstractSplitText](https://pixijs.download/release/docs/text.AbstractSplitText.html.md)
- [AbstractText](https://pixijs.download/release/docs/scene.AbstractText.html.md)

© pixijs · MIT · pixijs/pixijs-skills

Similar skills

Everything for Frontend and UI →

From the same set26

pixijs-assets Provides PixiJS v8 resource management patterns for AI coding agents. Helps configure Assets.load, bundles, manifests, and explicit parsers for extension-less URLs. CX Codex +1 5,900installs pixijs-scene-particle-container Guides coding agents through PixiJS v8 ParticleContainer setup. Helps render thousands of lightweight sprites in a single draw call. CX Codex +1 5,800installs pixijs-filters Guides PixiJS v8 visual effects through the filter pipeline. Use it for blur, colour adjustments, displacement, or custom shader effects. CX Codex +1 5,800installs pixijs-ticker A skill for per-frame logic in PixiJS v8: ticker callbacks, time units, priority ordering and frame rate capping. CX Codex +1 5,800installs pixijs-scene-core-concepts Explains how the PixiJS v8 scene graph fits together: containers, leaves, transforms and render order. Useful when your agent writes PixiJS code. CX Codex +1 5,900installs pixijs-math A skill covering coordinates, matrices, shapes and hit testing in PixiJS v8. Useful when a point has to move between coordinate spaces or a container needs a custom hit area. CX Codex +1 5,900installs pixijs-scene-mesh Guides custom 2D geometry rendering in PixiJS v8 via Mesh, MeshPlane, MeshRope, and PerspectiveMesh. Useful for per-frame vertex animations, rope trails, and perspective distortion. CX Codex +1 5,700installs pixijs-scene-dom-container Teaches the agent how to overlay HTML elements on a PixiJS v8 canvas with DOMContainer and DOMPipe. Useful for native inputs, iframes or video that must follow a display object. CX Codex +1 5,700installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor