aberrantmind Posted May 5, 2014 Share Posted May 5, 2014 I'm using arcade physics and trying to disply the bodies of a group of sprites using debug. I figured it'd be: game.debug.body(group); in the renderer function but that doesn't work. As an alternative I've used game.debug.quadTree(game.physics.arcade.quadTree); in renderer, but it doesn't allow as much control. that or I'm using it wrong... for instance, say I have 2 groups nested under one group1 = game.add.group();group1.enableBody = true;group2 = game.add.group();group2.enableBody = true;mainGroup = game.add.group(); mainGroup.add(group1);mainGroup.add(group2); and under the update function add: game.physics.arcade.collide(sprite, group1);game.physics.arcade.collide(sprite, group2); for some reason the debug function for quadTree will only display the last group in which collision is declared. So in the above case it'll only display the bodies of group2. If I were to declare group1 after group2, then it will display the bodies of group1. So.... I figure I'd just use another function just to display the bodies of a group, but as I started this post out with, I can't figure out how to do so. Any Ideas? Link to comment Share on other sites More sharing options...
MrRoboman Posted July 22, 2014 Share Posted July 22, 2014 Here's my solution:function render() { // call renderGroup on each of the alive members group.forEachAlive(renderGroup, this);}function renderGroup(member) { game.debug.body(member);}It's a work around, but it works! Arcanorum, Dread Knight, a_june and 5 others 8 Link to comment Share on other sites More sharing options...
samme Posted July 14, 2017 Share Posted July 14, 2017 group.forEach( game.debug.body, game.debug, checkExists, color, filled ); Link to comment Share on other sites More sharing options...
Madclaws Posted December 21, 2017 Share Posted December 21, 2017 game.debug.physicsGroup(Group); inside render function. samme 1 Link to comment Share on other sites More sharing options...
Recommended Posts