top

CAPH.WUI.ENGINE.RENDERING.CANVASRENDERER

The Canvas renderer displays your beautifully crafted BasePage not using WebGL, but draws it using the Canvas 2D Context API. In most of the cases, WebGL renderer has better performance than CanvasRenderer.


Constructor

CanvasRenderer

Description
The constructor of CanvasRender component, in order to create CanvasRender object.
Emulator SupportY
SDK ConstraintNone
Example
var AccRendering = caph.wui.engine.rendering;

var basePage = new AccRendering.BasePage();

var geometry = new AccRendering.CubeGeometry().build(100, 100, 100);

var matrial = new AccRendering.BasicMaterial();
var object = new AccRendering.Mesh3d(geometry, matrial.build({ color: Math.random() * 0xffffff, opacity: 0.5 }));


basePage.add(object);

var renderer = new AccRendering.CanvasRenderer();
renderer.render(basePage);

Methods

render

Description
Renders objects in the base page.
Parameters
■basepage
  - Object
  - An object of type BasePage
Return■Void
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;

var basePage = new AccRendering.BasePage();

var geometry = new AccRendering.CubeGeometry().build(100, 100, 100);

var matrial = new AccRendering.BasicMaterial();
var object = new AccRendering.Mesh3d(geometry, matrial.build({ color: Math.random() * 0xffffff, opacity: 0.5 }));


basePage.add(object);

var renderer = new AccRendering.CanvasRenderer();
renderer.render(basePage);

CanvasRenderer

Description
(Constructor) The constructor of CanvasRender component, in order to create CanvasRender object.
Parameters
■Void
Return■Object
  - instance of CanvasRenderer
Emulator SupportY
SDK Constraintnone
Example
var AccRendering = caph.wui.engine.rendering;

var basePage = new AccRendering.BasePage();

var geometry = new AccRendering.CubeGeometry().build(100, 100, 100);

var matrial = new AccRendering.BasicMaterial();
var object = new AccRendering.Mesh3d(geometry, matrial.build({ color: Math.random() * 0xffffff, opacity: 0.5 }));


basePage.add(object);

var renderer = new AccRendering.CanvasRenderer();
renderer.render(basePage);