Globals & Utilities
Script globals and helpers: console, timers, text encoding, tasks, signals and connections, and shared utility modules.
Commonly used
consoleOutput logging utilities for plugin scripts.setTimeoutCall callback after delayMs milliseconds.setIntervalRepeatedly call callback every delayMs milliseconds.Editor.ScopedConnectionStores event listener connections, automatically cleaned up on scope exit.Base64Utility class for encoding and decoding data in base64 format.TextEncoderEncodes strings into UTF-8 byte arrays.
Guides
All APIs in this topic
Import modules with import * as Ui from 'LensStudio:Ui'.
Components, assets, and modules
| API | Description |
|---|---|
| LensStudio:Event.js | |
| LensStudio:GeneralUtils.js |
Objects and data
| API | Description |
|---|---|
| Base64 | Utility class for encoding and decoding data in base64 format. |
| clearInterval | Remove the interval calls. |
| clearTimeout | Cancels the timeout. |
| console | Output logging utilities for plugin scripts. |
| createFunctionObject | Dynamically creates a function object from a string of JavaScript code. |
| Editor.ScopedConnection | Stores event listener connections, automatically cleaned up on scope exit. |
| Editor.Shape | Represents a 2D or 3D shape object. |
| Editor.Version | Version information for the editor or plugin. |
| global | |
| ScriptObject | Base class for all script-accessible Lens Studio objects. |
| setInterval | Repeatedly call callback every delayMs milliseconds. |
| setTimeout | Call callback after delayMs milliseconds. |
| signal0 | An interface that allows you to bind a callback on connect. |
| signal1 | An interface that allows you to bind a callback on connect. |
| signal2 | An interface that allows you to bind a callback on connect. |
| signal3 | An interface that allows you to bind a callback on connect. |
| signal4 | An interface that allows you to bind a callback on connect. |
| signal5 | An interface that allows you to bind a callback on connect. |
| Task | Namespace providing task management utilities for tracking and coordinating asynchronous operations. |
| TextDecoder | Decodes binary data from a Uint8Array into a string using a specified character encoding. |
| TextEncoder | Encodes strings into UTF-8 byte arrays. |
| Timeout | A handle for a timer. |
Enums
| API | Description |
|---|---|
| Editor.Axis | Enum of spatial axes. |