CompositionLayerComponent
ClassRepresents a composition layer that is rendered independently from the main scene and composited by the system compositor.
- Snapchat: not supported
- SPECS: fully supported
- Camera Kit Web: not supported
- Camera Kit Mobile: not supported
- SnapchatNot supported — SPECS only
- SPECSFully supported
- Camera Kit WebNot supported — SPECS only
- Camera Kit MobileNot supported — SPECS only
Since Lens Scripting v370
Represents a composition layer that is rendered independently from the main scene and composited by the system compositor. The type of the layer determines the underlying geometry (e.g. Quad).
Index
Properties
Methods
Remarks
The composition layer is hidden in capture or in display when its SceneObject's layer is in ScriptScene#hiddenInCapture or ScriptScene#hiddenInDisplay respectively.
Extends
Properties
anchorId
anchorId:
string
ExperimentalSPECS only
An optional anchor identifier for attaching this composition layer to a tracked anchor. When set, the layer's pose is driven by the anchor system instead of the SceneObject transform.
Since
Lens Scripting Version 370
Default Value
""
@experimental
@wearableOnly
enabled
enabled:
boolean
If disabled, the Component will stop enacting its behavior.
Default Value
true
Inherited from
isBeingDestroyed
readonlyisBeingDestroyed:boolean
Returns true if this Component is currently being destroyed. Becomes true as soon as
destruction begins via Component#destroy or destruction of its owning SceneObject,
before any OnDestroyEvent callbacks fire.
Since
Lens Scripting Version 364
Example
if (!script.isBeingDestroyed) {
// Component is still fully alive
}
Inherited from
isEnabledInHierarchy
readonlyisEnabledInHierarchy:boolean
Returns true if this Component, its SceneObject, and all of that SceneObjects parents are enabled.
Inherited from
Component.isEnabledInHierarchy
renderOrder
renderOrder:
number
SPECS only
Back-to-front render order: higher values render in front, lower (negative) values behind. The main projection layer is at 0, so a positive value renders the layer in front of it, a negative behind.
Since
Lens Scripting Version 370
Default Value
0
@wearableOnly
sceneObject
readonlysceneObject:SceneObject
The SceneObject this component is on.
Inherited from
smoothFollowDurationSec
smoothFollowDurationSec:
number
SPECS only
The duration in seconds for the composition layer to smooth follow the camera. Only used if smoothFollowEnabled is true.
Since
Lens Scripting Version 370
Default Value
0.3
@wearableOnly
smoothFollowEnabled
smoothFollowEnabled:
boolean
SPECS only
If true, the composition layer will smoothly follow the layer's current pose.
Since
Lens Scripting Version 370
Default Value
false
@wearableOnly
texture
texture:
Texture
SPECS only
The texture to display on this composition layer. This must be explicitly set when rendering into the layer to display content.
Since
Lens Scripting Version 370
Default Value
null
@wearableOnly
uniqueIdentifier
readonlyuniqueIdentifier:string
Since
Lens Scripting Version 176
Inherited from
Methods
destroy()
destroy():
void
Destroys the component.
Returns
void
Inherited from
getSceneObject()
getSceneObject():
SceneObject
Returns the SceneObject the component is attached to.
Returns
Inherited from
getTransform()
getTransform():
Transform
Returns the Transform this component is attached to.
Returns
Inherited from
getTypeName()
staticgetTypeName():TypeName<CompositionLayerComponent>
SPECS only
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<CompositionLayerComponent>
Since
Lens Scripting Version 370
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean