MCPcopy Create free account
hub / github.com/SilverTree7622/Phaser3_GUI_Inspector / DebugConsole

Function DebugConsole

js/utils/DebugConsoleFunc.js:2–41  ·  view source on GitHub ↗
(_obj)

Source from the content-addressed store, hash-verified

1
2export function DebugConsole(_obj) {
3 let tmpName = _obj.name;
4 let tmpVersion = _obj.version;
5 let tmpIC = _obj.initConfig;
6 let tmpA = 'ALPHA:' + tmpIC.css.alpha;
7 let tmpR = 'RIGHT:' + tmpIC.css.right;
8 let tmpT = 'TOP:' + tmpIC.css.top;
9 let tmpI = 'SIDE:' + tmpIC.init.side;
10 let tmpURL = _obj.url;
11 let tmp_nameNversion = '%c' + tmpName + ' v' + tmpVersion + ' \n';
12 let tmp_config = '%c INIT_CONFIG( ' + tmpA + ' | ' + tmpR + ' | ' + tmpT + ' | ' + tmpI + ' ) \n';
13 let tmp_url = '%c' + tmpURL;
14 let tmpShadowGap = 1;
15 let tmpShadowList = [
16 tmpShadowGap + 'px ' + -tmpShadowGap + 'px 0 rgb(217,31,38)',
17 tmpShadowGap * 2 + 'px ' + -tmpShadowGap * 2 + 'px 0 rgb(226,91,14)',
18 tmpShadowGap * 3 + 'px ' + -tmpShadowGap * 3 + 'px 0 rgb(245,221,8)',
19 tmpShadowGap * 4 + 'px ' + -tmpShadowGap * 4 + 'px 0 rgb(5,148,68)',
20 tmpShadowGap * 5 + 'px ' + -tmpShadowGap * 5 + 'px 0 rgb(2,135,206)',
21 tmpShadowGap * 6 + 'px ' + -tmpShadowGap * 6 + 'px 0 rgb(4,77,145)',
22 tmpShadowGap * 7 + 'px ' + -tmpShadowGap * 7 + 'px 0 rgb(42,21,113)'
23 ];
24 let tmpShadow = 'text-shadow:';
25 for (var i=0; i<tmpShadowList.length; i++) {
26 let tmpMiddle = ',';
27 if (i === tmpShadowList.length - 1) {
28 tmpMiddle = ';';
29 }
30 tmpShadow += tmpShadowList[i] + tmpMiddle;
31 }
32 let tmpStyle1 = 'font-weight:bold; font-size:25px; color: rgb(255, 111, 0);' + tmpShadow;
33 let tmpStyle2 = 'color: white; background: rgb(181, 0, 0); font-size: 12px;';
34 let tmpStyle3 = 'font-size: 12px;'
35
36 // final console log with vars
37 return console.log(
38 tmp_nameNversion + tmp_config + tmp_url,
39 tmpStyle1, tmpStyle2, tmpStyle3
40 );
41}
42
43// debug console log out the specific game object
44export function DebugGetThisConsole() {

Callers 1

initConsoleMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected