MCPcopy Index your code
hub / github.com/phaserjs/phaser / CreateDOMContainer

Function CreateDOMContainer

src/dom/CreateDOMContainer.js:25–52  ·  view source on GitHub ↗
(game)

Source from the content-addressed store, hash-verified

23 * @param {Phaser.Game} game - The Phaser Game instance to create the DOM container for.
24 */
25var CreateDOMContainer = function (game)
26{
27 var config = game.config;
28
29 if (!config.parent || !config.domCreateContainer)
30 {
31 return;
32 }
33
34 // DOM Element Container
35 var div = document.createElement('div');
36
37 div.style.cssText = [
38 'display: block;',
39 'width: ' + game.scale.width + 'px;',
40 'height: ' + game.scale.height + 'px;',
41 'padding: 0; margin: 0;',
42 'position: absolute;',
43 'overflow: hidden;',
44 'pointer-events: ' + config.domPointerEvents + ';',
45 'transform: scale(1);',
46 'transform-origin: left top;'
47 ].join(' ');
48
49 game.domContainer = div;
50
51 AddToDOM(div, config.parent);
52};
53
54module.exports = CreateDOMContainer;

Callers 1

Game.jsFile · 0.85

Calls 1

AddToDOMFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…