Class vxlView

the class that manages what it is rendered the HTML5 canvas on the web page


vxlView(canvasID, scene, handleLayout)
Each HTML5 canvas is assigned a view object (vxlView) in Voxelent's Nucleo.A vxlView provides the code to handle cameras, interaction and rendering capabilities, plus actor handling on the HTML5 canvas that otherwise would need to be written over and over for each applicationif you were writing a WebGL app from scratch.Luckily this is not the case. You have the awesome vxlView who takes care of all these little details for you.
Author: Diego Cantor.


String canvasID

id of the canvas in the DOM tree. That's all we need to setup a vxlView for you

vxlScene scene

if this view is sharing a scene, this parameter corresponds to the scene being shared.

Boolean handleLayout

if true or absent, the canvas will be resized dynamically


Clears the scene. Delegates this task to the renderer.
Forbids this view from going to Full Screen mode
Enables this view to go to Full Screen mode. Fullscreen mode is available by default.
Handles HTML5 Full screen for this view


Type Name Description
Boolean flag

set flag to true if fullscreen is wanted. Set it to false to exit fullscreen.

Get FPS metric from the view renderer
.handleEvent(event, source)
Handles the events to which a view is subscribed in Voxelent's Nucleo


Type Name Description
String event

the name of the event

Object source

the origin of the event. Useful to do callbacks if necessary

Refresh the view


Resets the view
Resizes the canvas so it fits its parent node in the DOM tree
Enables automatic resizing of the view when the browser window is resized


Type Name Description

enbles automatic resizing if true, disables it if false

.setBackgroundColor(r, g, b)
Sets the view's background color


Type Name Description
Number|Array|vec3 r

it can be the red component, a 3-dimensional Array or a vec3 (glMatrix)

Number g

if r is a number, then this parameter corresponds to the green component

Number b

if r is a number, then this parameter corresponds to the blue component


Sets the clear depth


Type Name Description
Number d

the new depth


Sets the drag and drop flag


Type Name Description
Boolean flag

Uses the interactor passed as parameter to handle user gestures


Type Name Description
vxlViewInteractor interactor

an instance of a vxlViewInteractor

Starts the view
Stops the view