<template>
<div>
</div>
</template>
<script setup>
import * as PIXI from 'pixi.js'
const app = new PIXI.Application({
width:window.innerWidth,
height:window.innerHeight,
backgroundColor:0x1099bb,
resolution:window.devicePixelRatio ||1,
antialias:true,
});
document.body.appendChild(app.view);
const texture = PIXI.Texture.from("./texture/剑.png")
const sprite = new PIXI.Sprite(texture)
sprite.anchor.set(0.5, 0.5)
sprite.x = app.screen.width / 2
sprite.y = app.screen.height / 2
sprite.rotation = Math.PI/4
sprite.scale.set(2, 2)
sprite.alpha = 0.8
app.stage.addChild(sprite)
app.ticker.add((delta)=>{
sprite.rotation += 0.01 * delta
})
</script>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
canvas{
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
}
</style>