samme Posted July 14, 2016 Share Posted July 14, 2016 Prints Phaser’s display tree. Demo / GitHub / NPM npm i phaser-plugin-scene-graph drhayes, VitaZheltyakov and Tom Atom 3 Link to comment Share on other sites More sharing options...
rich Posted July 15, 2016 Share Posted July 15, 2016 Very nice indeed Link to comment Share on other sites More sharing options...
LTNGames Posted July 15, 2016 Share Posted July 15, 2016 Nice, very useful. I will test it out sometime today. Thanks for sharing Link to comment Share on other sites More sharing options...
samme Posted July 15, 2016 Author Share Posted July 15, 2016 Here's a snippet to quickly look at a running game (run in console): (this.game || Phaser.GAMES[0]).load.script("SceneGraph", "https://samme.github.io/phaser-plugin-scene-graph/SceneGraph.js", function (){ this.game.plugins.add(Phaser.Plugin.SceneGraph).graph(); }).start(); Link to comment Share on other sites More sharing options...
samme Posted July 25, 2016 Author Share Posted July 25, 2016 Now with filter and map: game.debug.graph(obj, { // options: collapse: true, filter: null, // function (obj) -> true || false map: null, // function (obj) -> "description" skipDead: false, skipNonexisting: false }); Link to comment Share on other sites More sharing options...
stupot Posted July 26, 2016 Share Posted July 26, 2016 On 14/07/2016 at 7:51 PM, samme said: Prints Phaser’s display tree in the console. Demo / Code Nice, another addition to the available arsenal of Phaser Debugging tools. I made a little modification to pass a config object to the initialiser and added a new property to the config to determine if the plugin dumps it's initialisation info to the console or not. Do you want it, either the modified source file or via github PR. Link to comment Share on other sites More sharing options...
samme Posted July 28, 2016 Author Share Posted July 28, 2016 Sure, post the modified source. Link to comment Share on other sites More sharing options...
stupot Posted July 28, 2016 Share Posted July 28, 2016 9 hours ago, samme said: Sure, post the modified source. Here it is. Mostly I didn't want the plugin to affect the console when it initialises, but having it process a config object on initialisation could be useful anyway. To initialise the plugin without it dumping to the console, you would do: game.plugins.add(Phaser.Plugin.SceneGraph, {'quiet':true}); SceneGraph.js Link to comment Share on other sites More sharing options...
samme Posted July 30, 2016 Author Share Posted July 30, 2016 Done! https://github.com/samme/phaser-plugin-scene-graph Link to comment Share on other sites More sharing options...
samme Posted December 20, 2016 Author Share Posted December 20, 2016 There's now a "live" view of one level of the display tree with `game.debug.renderGraph()`. It can help you keep track of object pools (Weapons, Emitters, enemies) and also identify unusual situations (empty/dead groups, dead-but-existing sprites). Try the new demo. Tom Atom and stupot 2 Link to comment Share on other sites More sharing options...
Recommended Posts