video
namespace video
Public Properties
renderer: CanvasRenderer | WebGLRenderer = undefined
CanvasRenderer | WebGLRenderer
A reference to the active Canvas or WebGL active renderer renderer
Public Methods
createCanvas(width: number, height: number, returnOffscreenCanvas: boolean) → {HTMLCanvasElement | OffscreenCanvas}
Create and return a new Canvas element
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
width | number |
width |
||
height | number |
height |
||
returnOffscreenCanvas | boolean |
<optional> |
false |
will return an OffscreenCanvas if supported |
Type | Description |
---|---|
HTMLCanvasElement | OffscreenCanvas |
a new Canvas element of the given size |
getParent() → {HTMLElement}
return a reference to the parent DOM element holding the main canvas
Type | Description |
---|---|
HTMLElement |
the HTML parent element |
init(width: number, height: number, options: ApplicationSettings) → {boolean}
Initialize the "video" system (create a canvas based on the given arguments, and the related renderer).
// init the video with a 640x480 canvas
me.video.init(640, 480, {
parent : "screen",
renderer : me.video.AUTO,
scale : "auto",
scaleMethod : "fit"
});
Name | Type | Attributes | Description |
---|---|---|---|
width | number |
The width of the canvas viewport |
|
height | number |
The height of the canvas viewport |
|
options | ApplicationSettings |
<optional> |
optional parameters for the renderer |
Type | Description |
---|---|
boolean |
false if initialization failed (canvas not supported) |