/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
examples/rendering_render-layer/CharacterUI.ts
31 строка
627 B
Zyie
chore: overhaul documentation system with TypeDoc plugins, examples, and guides (#11905)
12 фев 2026, 16:28
Не верифицирован
12 фев 2026, 16:28
ab6752d
Код
Авторство
О чём код?
import { Container, Graphics, Text } from 'pixi.js'; export class CharacterUI extends Container { constructor(name) { super(); const label = new Text({ text: name, resolution: 2, style: { fontSize: 16, fill: 0x000000 }, anchor: 0.5, }); const padding = 10; const bg = new Graphics() .roundRect( (-label.width / 2) - padding, (-label.height / 2) - padding, label.width + (padding * 2), label.height + (padding * 2), 20, ) .fill({ color: 0xffff00, alpha: 1, }); this.addChild(bg, label); } }