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 layerLayer Layer containing the shader
originalUniformNamestring Original name of the uniform in shader or filter
uiNamestring Display name for the UI
uiTypestring Control type ('checkbox'|'line-edit'|'slider')
uiMinDisplayednumber 0 Minimum displayed value (for slider/line-edit)
uiMaxDisplayednumber 100 Maximum displayed value (for slider/line-edit)
uiMinnumber 0 Minimum actual uniform value
uiMaxnumber 1 Maximum actual uniform value
uiNStepDisplayednumber 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_onLayer | string Layer or layer ID to activate
- Source:
-
showOverlayMessage(msg [, duration])
-
Shows overlay message
Parameters:
Name Type Argument Default Description msgstring Message to display
durationnumber <optional>
2000 Display duration in ms
- Source: