/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
examples/dom-container_html_text-area.ts
31 строка
834 B
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 integrate a DOM element into a PixiJS application using DOMContainer import { Application, DOMContainer } from 'pixi.js'; (async () => { const app = new Application(); await app.init({ backgroundColor: 0x1099bb, resizeTo: window }); document.body.appendChild(app.canvas); document.body.style = 'margin: 0; overflow: hidden'; // Create a DOM element const element = document.createElement('textarea'); element.value = 'Type here...'; // Create a DOM container const domContainer = new DOMContainer({ element, x: app.screen.width / 2, y: app.screen.height / 2, anchor: 0.5, }); // Add it to your scene app.stage.addChild(domContainer); app.ticker.add(() => { // Rotate the DOM container domContainer.rotation += 0.01; }); })();