JSFiddle - React, Tailwind, and code Playground
by ShukantPal
HTML
<script src="https://pixijs.download/v5.2.1/pixi.js"></script>
<!DOCTYPE html>
<html>
<body>
<canvas id="demo"></canvas>
</body>
</html>
JavaScript
const app = new PIXI.Application({
view: document.getElementById("demo"),
width: 512,
height: 512,
backgroundColor: 0xffffff,
resolution: 2,
autoDensity: true
})
let width = 0
app.ticker.add((t) => {
width += (t)
width %= 150
app.stage.removeChildren()
app.stage.addChild(new PIXI.Graphics()
.lineStyle({
width
})
.moveTo(150, 100)
.lineTo(200, 450)
.lineTo(250, 100))
})