JSFiddle - React, Tailwind, and code Playground
by Felix Schoeler
HTML
<script src="http://cdnjs.cloudflare.com/ajax/libs/pixi.js/2.2.3/pixi.js"></script>
<body>
</body>
JavaScript
var stage = new PIXI.Stage(0x00FF00);
var renderer = new PIXI.WebGLRenderer(400, 400);
document.body.appendChild(renderer.view);
var graphics = new PIXI.Graphics();
stage.addChild(graphics);
graphics.lineStyle(3, 0x000000, 1);
graphics.moveTo(0, 0);
//this works:
//graphics.lineTo(100, 100);
//this doesn't:
setTimeout(function(graphics) {
graphics.clear();
graphics.lineStyle(3, 0x000000, 1);
graphics.moveTo(0,0)
graphics.lineTo(100.1, 100);
}, 3000, graphics);
requestAnimFrame(animate);
function animate() {
requestAnimFrame(animate);
renderer.render(stage);
}