Puzz3l Posted April 19, 2014 Share Posted April 19, 2014 So I'm playing around with hitbox bounds, but I want to actually be able to see the hitbox in-game. Is there a way to do that? ylluminarious 1 Link to comment Share on other sites More sharing options...
ctmartinez1992 Posted April 20, 2014 Share Posted April 20, 2014 On the render function, try to callgame.debug.body(spritename); Link to comment Share on other sites More sharing options...
Puzz3l Posted April 20, 2014 Author Share Posted April 20, 2014 Thanks! Since I had to wait a day between posting this and getting it approved by a mod I just did what I should have done before and looked it up in the docs Link to comment Share on other sites More sharing options...
jpdev Posted April 20, 2014 Share Posted April 20, 2014 important note (for future users finding this question), as it's already working for you. This only works in canvas mode (so you might have to initialize your game with Phaser.CANVAS instead of Phaser.AUTO) Puzz3l and deiii 2 Link to comment Share on other sites More sharing options...
Rezalas Posted December 28, 2014 Share Posted December 28, 2014 Just to help anyone that happens to need to do this to a group, you can call game.debug.body using forEachAlive but you need to set the context to game.debug otherwise you'll receive an error about there being no start() method in the existing context (since sprites have no start method, and the function game.debug.body assumes the scope of 'this' is the parent scope). ex: debugMode: function () { game.debug.body(this.captain, "#9090ff", false); this.enemy.forEachAlive(game.debug.body,game.debug,"#ff9090",false); this.redLasers.forEach(game.debug.body,game.debug,"#dd00dd",false); this.blueLasers.forEach(game.debug.body,game.debug,"#00dd00",false); }, Link to comment Share on other sites More sharing options...
Recommended Posts