Phaser 3 Extended update sprite bug
HTML
<script src="https://cdn.jsdelivr.net/gh/photonstorm/[email protected]/dist/phaser.min.js"></script>
<div id="phaser-example"> </div>
Babel + JSX
var config = {
type: Phaser.AUTO,
parent: 'phaser-example',
width: 800,
height: 600,
scene: {
preload: preload,
create: create
}
};
var game = new Phaser.Game(config);
function preload ()
{
}
function create ()
{
// rectangle variable
var r1 = this.add.graphics();
// draw rectangle
r1.fillStyle(0xffb000, 1);
r1.fillRect(450, 200, 200, 200);
r1.setInteractive(new Phaser.Geom.Rectangle(450, 200, 200, 200));
// pointer on rectangle
r1.on('pointerover', function () {r1.alpha = 0.5;});
r1.on('pointerout', function () {r1.alpha = 1.0;});
}