JSFiddle - React, Tailwind, and code Playground

by ShukantPal

HTML

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pixi.min.js"></script>

JavaScript

const canvas = { width : 300, height : 300 };

var app = new PIXI.Application({
    width: canvas.width,
    height: canvas.height,
    backgroundColor: 0x2c3e50
});
document.body.appendChild(app.view);

const shape = new PIXI.Graphics();
shape.beginFill(0xffffff,1);
shape.drawRect(20,20,70,100);
shape.endFill();
app.stage.addChild(shape);

// scaling
const scale_factor = 0.8;
app.stage.scale.x = scale_factor;
app.stage.scale.y = scale_factor;
app.renderer.resize(canvas.width * scale_factor, canvas.height * scale_factor)