Skip to main content

LensStudio:HierarchyUtils.js.getOrCreateCanvas

Function

Retrieves or creates a canvas component for a given camera object.

getOrCreateCanvas(cameraObject, unitType): Canvas

Retrieves or creates a canvas component for a given camera object.

Parameters

ParameterTypeDescription
cameraObjectSceneObjectThe camera object to retrieve or create the canvas component for.
unitTypeUnitTypeThe unit type for the canvas component.

Returns

Canvas

The canvas component associated with the camera object.