import * as PIXI from 'pixi.js';
const app = new PIXI.Application({ background: '#1099bb', resizeTo: window });
document.body.appendChild(app.view);
PIXI.Assets.load('https://pixijs.com/assets/spritesheet/fighter.json').then(() =>
{
const frames = [];
for (let i = 0; i < 30; i++)
{
const val = i < 10 ? `0${i}` : i;
frames.push(PIXI.Texture.from(`rollSequence00${val}.png`));
}
const anim = new PIXI.AnimatedSprite(frames);
anim.x = app.screen.width / 2;
anim.y = app.screen.height / 2;
anim.anchor.set(0.5);
anim.animationSpeed = 0.5;
anim.play();
app.stage.addChild(anim);
app.ticker.add(() =>
{
anim.rotation += 0.01;
});
});