Canvas.addToDOM()

<static> addToDOM(canvas, parent, overflowHidden) → {HTMLCanvasElement}

Adds the given canvas element to the DOM. The canvas will be added as a child of the given parent.
If no parent is given it will be added as a child of the document.body.

Parameters
Name Type Argument Default Description
canvas HTMLCanvasElement

The canvas to be added to the DOM.

parent string | HTMLElement

The DOM element to add the canvas to.

overflowHidden boolean <optional>
true

If set to true it will add the overflow='hidden' style to the parent DOM element.

Returns
HTMLCanvasElement -

Returns the source canvas.

Source code: utils/Canvas.js (Line 109)
doc_phaser
2017-02-14 10:41:01
Comments
Leave a Comment

Please login to continue.