/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
examples/text_tagged-text.ts
39 строк
1 KB
Zyie
chore: overhaul documentation system with TypeDoc plugins, examples, and guides (#11905)
12 фев 2026, 16:28
Не верифицирован
12 фев 2026, 16:28
ab6752d
Код
Авторство
О чём код?
// description: This example demonstrates how to use tagged text to style individual parts of a text string. import { Application, Text } from 'pixi.js'; (async () => { const app = new Application(); await app.init({ background: '#1a1a2e', resizeTo: window, antialias: true }); document.body.appendChild(app.canvas); const text = new Text({ text: '<bold>PixiJS v8.16</bold> ships with <highlight>tagged text</highlight>, letting you apply <italic>per-word styling</italic> using simple <bold><highlight>inline tags</highlight></bold>.', style: { fontFamily: 'Arial', fontSize: 28, fill: '#e0e0e0', wordWrap: true, wordWrapWidth: app.screen.width - 80, lineHeight: 42, tagStyles: { bold: { fontWeight: 'bold', fill: 'white', }, highlight: { fill: '#00d4ff', fontSize: 30, }, italic: { fontStyle: 'italic', fill: '#ffd700', }, }, }, }); text.x = 40; text.y = (app.screen.height / 2) - (text.height / 2); app.stage.addChild(text); })();