/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
tests/visual/scenes/text-split/text-split.scene.ts
33 строки
878 B
Zyie
chore: reorganizes visual scene tests into logical subdirectories (#11872)
04 фев 2026, 16:38
Не верифицирован
04 фев 2026, 16:38
13d3c27
Код
Авторство
О чём код?
import { Assets } from '~/assets'; import { SplitText, Text } from '~/scene'; import type { TestScene } from '../../types'; import type { Container } from '~/scene'; export const scene: TestScene = { it: 'should render a split text correctly', create: async (scene: Container) => { await Assets.load('fonts/outfit.woff2'); const textBitmap = new Text({ text: 'Canvas', style: { fontFamily: 'Outfit', fontSize: 35, }, }); // Split the text into characters and words const splitResult = SplitText.from(textBitmap); scene.addChild(splitResult); // move each character to a fixed y position splitResult.chars.forEach((char, i) => { char.y = 10 + (i * 10); scene.addChild(char); }); }, };