() => { return { modules: ['https://cdnjs.cloudflare.com/ajax/libs/pixi.js/8.1.0/pixi.min.js'], body: `
`, script: () => { console.log("VOALA", PIXI) const { Application, Assets, Sprite, Texture } = PIXI; (async () => { const app = new Application(); await app.init({ background: '#1099bb', resizeTo: window }); document.body.appendChild(app.canvas); const texture = await Assets.load('https://pixijs.com/assets/bunny.png'); const bunny = new Sprite(texture); bunny.anchor.set(0.5); bunny.x = app.screen.width / 2; bunny.y = app.screen.height / 2; app.stage.addChild(bunny); app.ticker.add((time) => { // Just for fun, let's rotate mr rabbit a little. // * Delta is 1 if running at 100% performance * // * Creates frame-independent transformation * bunny.rotation += 0.1 * time.deltaTime; }); })(); } } }