Merge pull request #348 from rschamp/get-canvas

Add getter for the renderer's canvas
This commit is contained in:
Ray Schamp
2018-09-18 16:01:53 -04:00
committed by GitHub

View File

@@ -201,6 +201,13 @@ class RenderWebGL extends EventEmitter {
return this._gl;
}
/**
* @returns {HTMLCanvasElement} the canvas of the WebGL rendering context associated with this renderer.
*/
get canvas () {
return this._gl && this._gl.canvas;
}
/**
* Set the physical size of the stage in device-independent pixels.
* This will be multiplied by the device's pixel ratio on high-DPI displays.