samme

Phaser Scene Graph plugin

Recommended Posts

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();

 

Share this post


Link to post
Share on other sites

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
});

 

Share this post


Link to post
Share on other sites

 

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.