(game)
| 22 | * @param {Phaser.Game} game - The Phaser.Game instance which will output this debug header. |
| 23 | */ |
| 24 | var DebugHeader = function (game) |
| 25 | { |
| 26 | var config = game.config; |
| 27 | |
| 28 | if (config.hideBanner) |
| 29 | { |
| 30 | return; |
| 31 | } |
| 32 | |
| 33 | var renderType = 'WebGL'; |
| 34 | |
| 35 | if (config.renderType === CONST.CANVAS) |
| 36 | { |
| 37 | renderType = 'Canvas'; |
| 38 | } |
| 39 | else if (config.renderType === CONST.HEADLESS) |
| 40 | { |
| 41 | renderType = 'Headless'; |
| 42 | } |
| 43 | |
| 44 | var audioConfig = config.audio; |
| 45 | var deviceAudio = game.device.audio; |
| 46 | |
| 47 | var audioType; |
| 48 | |
| 49 | if (deviceAudio.webAudio && !audioConfig.disableWebAudio) |
| 50 | { |
| 51 | audioType = 'Web Audio'; |
| 52 | } |
| 53 | else if (audioConfig.noAudio || (!deviceAudio.webAudio && !deviceAudio.audioData)) |
| 54 | { |
| 55 | audioType = 'No Audio'; |
| 56 | } |
| 57 | else |
| 58 | { |
| 59 | audioType = 'HTML5 Audio'; |
| 60 | } |
| 61 | |
| 62 | if (!game.device.browser.ie) |
| 63 | { |
| 64 | var logoDataURI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARBJREFUeNpi/P//P0OHsPB/BiCoePuWkYFEwALSXJElzMBgLwE2CNkQxgWr/yMr/p8QimlBu5DQ//+8vBBco/ofzAe6imH+qv/53/6jYJAYSA4ZoxoANYTPKhiuCQZwGcJU+e4dqpMmvsDq14krV2MPAxDha2CMKvoXoiE/PBQUDgQD8j82UFae9B9bOIC8B9UD9gIjjIMN7Ns6lWHn4XMoYu62RgxO3tkMjIyMII2MYAOAtmFVhA+ADHf2ycGMRhANjUq8YO+WKWCvgAORIV8CkpDCrzIwsLIymC1qAtuAD4Bsh3sBmqAY3qcGwL2AC4DCpKtzHlgzOLWihwEuzTCN0GhDJHeYC4gByBphACDAAH2dDIxdjr+VAAAAAElFTkSuQmCC'; |
| 65 | |
| 66 | var mainStyle = 'color: ' + config.bannerTextColor + ';'; |
| 67 | |
| 68 | var bannerBackgroundColor = Array.isArray(config.bannerBackgroundColor) |
| 69 | ? config.bannerBackgroundColor |
| 70 | : [ config.bannerBackgroundColor ]; |
| 71 | |
| 72 | // linear-gradient requires at least two color stops, so duplicate if there's only one |
| 73 | if (bannerBackgroundColor.length === 1) |
| 74 | { |
| 75 | bannerBackgroundColor = [ bannerBackgroundColor[0], bannerBackgroundColor[0] ]; |
| 76 | } |
| 77 | |
| 78 | var gradient = 'linear-gradient(to bottom, ' + bannerBackgroundColor.join(', ') + ')'; |
| 79 | |
| 80 | mainStyle += ' background-image: url("' + logoDataURI + '"), ' + gradient + ';'; |
| 81 | mainStyle += ' background-repeat: no-repeat;'; |
no outgoing calls
no test coverage detected
searching dependent graphs…