MCPcopy Create free account
hub / github.com/melonjs/melonJS / consoleHeader

Function consoleHeader

packages/melonjs/src/application/header.ts:8–34  ·  view source on GitHub ↗
(app: Application)

Source from the content-addressed store, hash-verified

6 * @param app - the game application instance calling this function
7 */
8export function consoleHeader(app: Application): void {
9 const renderType = app.renderer.type;
10 const gpu_renderer =
11 typeof app.renderer.GPURenderer === "string"
12 ? ` (${app.renderer.GPURenderer})`
13 : "";
14 const audioType = device.hasWebAudio ? "Web Audio" : "HTML5 Audio";
15
16 // output video information in the console
17 console.log(
18 `${renderType} renderer${gpu_renderer} | ${audioType} | ` +
19 `pixel ratio ${device.devicePixelRatio} | ${
20 device.platform.nodeJS
21 ? "node.js"
22 : device.platform.isMobile
23 ? "mobile"
24 : "desktop"
25 } | ${device.getScreenOrientation()} | ${device.language}`,
26 );
27
28 console.log(
29 `resolution: ` +
30 `requested ${(app.settings as any).width}x${
31 (app.settings as any).height
32 }, got ${app.renderer.width}x${app.renderer.height}`,
33 );
34}

Callers 1

initMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected