amirantos Posted November 20, 2018 Share Posted November 20, 2018 I just started learning Phaser 3 and faced some magic behaviour. I can't draw rectangle without circle! This code works: var config = { type: Phaser.AUTO, width: 800, height: 600, backgroundColor: 0xffffff, physics: { default: 'arcade', arcade: { gravity: { y: 200 } } }, scene: [{ preload: preload, create: create }] }; var game = new Phaser.Game(config); function preload () { } function create () { this.add.circle(config.width/2, config.height/2, 20, 0xff0000); this.add.rectangle(config.width/2, config.height/2 + 30, 3, 50, 0xff0000); } But if when I try to comment this.add.circle - nothing shows! Is it phaser bug or am I doing something wrong? Link to comment Share on other sites More sharing options...
rich Posted November 20, 2018 Share Posted November 20, 2018 Yes, this is a bug in 3.15.1 - you don't have to add a circle, any object will do! Or just add a stroke to the rectangle. This is fixed in 3.16 (currently in the master branch, will be made public in a few weeks) Link to comment Share on other sites More sharing options...
Recommended Posts