blackhawx Posted September 18, 2018 Share Posted September 18, 2018 Hello, I'm working with Phaser 3.12.0 and I'm attempting to experiment with debugging in general. I am failing to get any debug information with the following game code.... const config = { type: Phaser.AUTO, width: 640, height: 480, backgroundColor: "#000044", // physics settings physics: { // we are using matter.js engine that is built into Phaser default: "matter", arcade: { debug: true } }, scene: { init: init, preload: preload, create: create, render:render } }; let game = new Phaser.Game(config); function init() { console.log('the initializer'); } function preload() { console.log('the preload'); this.load.image("crate", "game04/media/crate.png"); } function create() { console.log('the the update'); this.matter.world.setBounds(0, -200, game.config.width, game.config.height + 200); // waiting for user input this.input.on("pointerdown", function (pointer) { console.log('we are clicking for an event to fire'); // getting Matter bodies under the pointer var bodiesUnderPointer = Phaser.Physics.Matter.Matter.Query.point(this.matter.world.localWorld.bodies, pointer); // if there isn't any body under the pointer... if (bodiesUnderPointer.length == 0) { // create a crate this.matter.add.sprite(pointer.x, pointer.y, "crate"); } // this is where I wanted to remove the crate. Unfortunately I did not find a quick way to delete the Sprite // bound to a Matter body, so I am setting it to invisible, then remove the body. else { bodiesUnderPointer[0].gameObject.visible = false; this.matter.world.remove(bodiesUnderPointer[0]) } }, this); } function render() { // Camera game.debug.cameraInfo(game.camera, 32, 32); } I guess I just need a basic understanding of how to debug through Phaser 3. I borrowed some examples from the labs and placed them in here, in hope to see something. But like I said, absolutely no debug information is being displayed. What would be a potential reason? Thanks Link to comment Share on other sites More sharing options...
iKest Posted September 18, 2018 Share Posted September 18, 2018 WTF? physics: { // we are using matter.js engine that is built into Phaser default: "matter", arcade: { debug: true } }, Link to comment Share on other sites More sharing options...
blackhawx Posted September 18, 2018 Author Share Posted September 18, 2018 I'm using the following 2 projects as a reference https://www.emanueleferonato.com/2018/02/21/your-first-phaser-3-matter-js-physics-example/ http://labs.phaser.io/edit.html?src=src\physics\arcade\simple body.js Link to comment Share on other sites More sharing options...
iKest Posted September 18, 2018 Share Posted September 18, 2018 physics: { // we are using matter.js engine that is built into Phaser default: "matter", matter: { debug: true } }, blackhawx 1 Link to comment Share on other sites More sharing options...
rich Posted September 18, 2018 Share Posted September 18, 2018 The debug.cameraInfo line of code is from Phaser 2. It doesn’t do anything in v3 (I’m surprised it didn’t throw an error to be honest!) shortland and blackhawx 2 Link to comment Share on other sites More sharing options...
Recommended Posts