Jump to content

Phaser version debug header in the console


San4er
 Share

Recommended Posts

I saw some game requirements of some sponsors and portals. One of them was a clear console without any debug info in it.

When I use Phaser it executes showDebugHeader() at the start by default and AFAIK there is no way to turn it off.

I can only disable it by commenting this function on the source code of phaser.js.

My question is - can I do that? Is it OK or wrong to do that? I respect Phaser.js developers and if they want to show it necessarily, I won't hide it.

And it would be good if it could be disabled in a way like:

game.debug.showDebugHeader=false;

or something like that:)

Link to comment
Share on other sites

There are hundreds of Phaser games over hundreds of different portals, all showing that header. So I wouldn't worry about it. It's not "debug" info in the sense they mean.

 

If you really do want to remove it then you can edit the call out of core/Game.js and rebuild your own version. You are absolutely allowed and free to do this, but it's not something we're going to provide directly via the API as it has proven to be the most effective form of getting Phaser known, ever :)

Link to comment
Share on other sites

  • 2 years later...

This is also annoying in unit tests output when you have new game instance created before each of hundreds tests. Currently in my tests I'm turning this off by overriding showDebugHeader with empty function:

beforeAll(()=>{
	Phaser.Game.prototype.showDebugHeader = function(){}
})

 

But it would be nice if we have valid switch for that.

Link to comment
Share on other sites

There is already a global switch to disable this (my post above is from 2014.. things change):

window.PhaserGlobal = {
  hideBanner: true
};

I cannot stress enough how important it is to have a local copy of the source code. Had you looked at that first, you would have seen the first line of the showDebugHeader function is:

        if (window['PhaserGlobal'] && window['PhaserGlobal'].hideBanner)
        {
            return;
        }

Which would have answered your question instantly.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...