/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
tests/visual/scenes/text-split/text-basic-split.scene.ts
38 строк
1 KB
Zyie
chore: reorganizes visual scene tests into logical subdirectories (#11872)
04 фев 2026, 16:38
Не верифицирован
04 фев 2026, 16:38
13d3c27
Код
Авторство
О чём код?
import { SplitText, Text } from '~/scene'; import type { TestScene } from '../../types'; import type { Container } from '~/scene'; export const scene: TestScene = { it: 'should render text correctly if style changes using split text', create: async (scene: Container) => { const text = new Text({ text: 'I should be red & white and wrapping with shadow 🔥', style: { fontSize: 18, fill: 'white', stroke: { color: 'white', width: 2 }, lineHeight: 15, letterSpacing: 6, align: 'center', dropShadow: { alpha: 1, angle: Math.PI / 6, blur: 5, color: 'blue', distance: 5, }, }, }); const splitResult = SplitText.from(text); scene.addChild(splitResult); splitResult.style.wordWrap = true; splitResult.style.fill = 'red'; splitResult.style.wordWrapWidth = 120; splitResult.styleChanged(); }, };