Skip to main content

CompositionLayerRenderComponent

Class

Controls the rendering behavior of a composition layer, including when it should be re-rendered and adaptive resolution settings.

  • 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

Platform details

  • Snapchat — Not supported — SPECS only.

  • SPECS — Fully supported.

  • Camera Kit Web — Not supported — SPECS only.

  • Camera Kit Mobile — Not supported — SPECS only.

Since Lens Scripting v370

Controls the rendering behavior of a composition layer, including when it should be re-rendered and adaptive resolution settings.

Index

Extends

Properties

adaptiveResolutionEnabled

adaptiveResolutionEnabled: boolean

SPECS only

If true, the composition layer's render resolution is dynamically scaled based on the projected screen-space size of the layer in the main camera's view.

Since

Lens Scripting Version 370

Default Value

false
@wearableOnly

adaptiveResolutionRoundingMultiple

adaptiveResolutionRoundingMultiple: number

SPECS only

The final render resolution will be rounded to the nearest higher multiple of this value. Only used if adaptiveResolutionEnabled is true.

Since

Lens Scripting Version 370

Default Value

32
@wearableOnly

adaptiveResolutionScaler

adaptiveResolutionScaler: number

SPECS only

The scaler for adaptive resolution. The final render resolution will be the composition layer's screen size multiplied by this scaler. Only used if adaptiveResolutionEnabled is true.

Since

Lens Scripting Version 370

Default Value

1
@wearableOnly

enabled

enabled: boolean

If disabled, the Component will stop enacting its behavior.

Default Value

true

Inherited from

Component.enabled


isBeingDestroyed

readonly isBeingDestroyed: 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

Component.isBeingDestroyed


isEnabledInHierarchy

readonly isEnabledInHierarchy: boolean

Returns true if this Component, its SceneObject, and all of that SceneObjects parents are enabled.

Inherited from

Component.isEnabledInHierarchy


sceneObject

readonly sceneObject: SceneObject

The SceneObject this component is on.

Inherited from

Component.sceneObject


uniqueIdentifier

readonly uniqueIdentifier: string

Since

Lens Scripting Version 176

Inherited from

Component.uniqueIdentifier


updateModes

updateModes: number

SPECS only

Controls when the composition layer should be (re-)rendered - by default Visibility.

Since

Lens Scripting Version 370

Default Value

CompositionLayer.Render.UpdateMode.Visibility
@wearableOnly

Methods

destroy()

destroy(): void

Destroys the component.

Returns

void

Inherited from

Component.destroy


getSceneObject()

getSceneObject(): SceneObject

Returns the SceneObject the component is attached to.

Returns

SceneObject

Inherited from

Component.getSceneObject


getTransform()

getTransform(): Transform

Returns the Transform this component is attached to.

Returns

Transform

Inherited from

Component.getTransform


getTypeName()

static getTypeName(): TypeName<CompositionLayerRenderComponent>

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<CompositionLayerRenderComponent>

Since

Lens Scripting Version 370

Overrides

Component.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

Component.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

Component.isOfType


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

ParameterType
otherScriptObject

Returns

boolean

Inherited from

Component.isSame


requestRender()

requestRender(): void

SPECS only

Requests the composition layer to be re-rendered on the next frame. Only meaningful when updateModes includes Manual.

Returns

void

Since

Lens Scripting Version 370