new UIBasic(viewer [, options])
Creates a new UIBasic instance
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
viewer |
Viewer | OpenLIME viewer instance |
|
options |
UIBasic~Options |
<optional> |
Configuration options |
- Source:
Fires:
- UIBasic#event:lightdirection
Example
```javascript const ui = new UIBasic(viewer, { // Enable specific actions actions: { light: { display: true }, zoomin: { display: true }, layers: { display: true } }, // Add measurement support pixelSize: 0.1, // Add attribution attribution: "© Example Source" }); ```
Methods
-
addUniformUI(layer, originalUniformName, uiName, uiType, uiMinDisplayed, uiMaxDisplayed, uiMin, uiMax, uiNStepDisplayed)
-
Adds a UI control for a shader uniform
Parameters:
Name Type Default Description layer
Layer Layer containing the shader
originalUniformName
string Original name of the uniform in shader or filter
uiName
string Display name for the UI
uiType
string Control type ('checkbox'|'line-edit'|'slider')
uiMinDisplayed
number 0 Minimum displayed value (for slider/line-edit)
uiMaxDisplayed
number 100 Maximum displayed value (for slider/line-edit)
uiMin
number 0 Minimum actual uniform value
uiMax
number 1 Maximum actual uniform value
uiNStepDisplayed
number 100 Number of steps for slider (granularity control)
- Source:
Returns:
Whether the uniform was found and UI created
- Type
- boolean
-
setLayer(layer_on)
-
Sets active layer and updates UI
Parameters:
Name Type Description layer_on
Layer | string Layer or layer ID to activate
- Source:
-
showOverlayMessage(msg [, duration])
-
Shows overlay message
Parameters:
Name Type Argument Default Description msg
string Message to display
duration
number <optional>
2000 Display duration in ms
- Source: