Constructor
new HUD(camera)
Parameters:
Name | Type | Description |
---|---|---|
camera |
to track, by default tracks active camera |
Classes
Methods
addButton(text, imageUrl, onPointerDown)
Create a button with given text and image and add it to the HUD
Parameters:
Name | Type | Description |
---|---|---|
text |
description to display | |
imageUrl |
image to display | |
onPointerDown |
callback function activated when pressed |
Returns:
a BabylonJS HolographicButton
addColorPicker()
Adds color picker to the HUD.
Returns:
babylon ColorPicker object
addSlider()
Adds a slider to the HUD.
Returns:
babylon Slider object
rescaleHUD()
Window.resize event handler, rescales the HUD if aspect ratio is too small for all buttons to fit.
showButtons(show, …except)
Show or hide all HUD elements (buttons)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
show |
show or hide | ||
except |
<repeatable> |
optional element(s) to skip |
trackCamera()
Handles camera change events, typically while entering/exiting VR.