canvas

Note: This documentation is for the old 0.2.0 version of A-Frame. Check out the documentation for the current 0.5.0 version

The canvas component allows us to specify our own canvas or the size of the injected canvas. The canvas component applies only to the <a-scene> element.

Example

We can specify our own canvas.

<a-scene canvas="canvas: #mycanvas"></a-scene>

Or specify the width and height in percent of the injected canvas.

<a-scene canvas="height: 50; width: 50"></a-scene>

Properties

PropertyDescriptionDefault Value
canvasSelector to a canvas element that exists on the page.null
heightHeight of the injected canvas, in percentage.100
WidthWidth of the injected canvas, in percentage.100