Skip to main content

ThrottleState

Class

A complete snapshot of the device's Dynamic Power Manager throttle state.

  • 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 v387

A complete snapshot of the device's Dynamic Power Manager throttle state. Passed to the SnapOS.onThrottleStateChanged event whenever the merged throttle state changes.

Index

Example

// Disable optional visual effects while the device is throttling.
//@input SceneObject vfxRoot
SnapOS.onThrottleStateChanged.add(function (state) {
script.vfxRoot.enabled = state.mode === ThrottleMode.None;
});

Extends

Properties

frameFactor

readonly frameFactor: number

SPECS onlySPECS

The compositor frame-factor cap reported by the Dynamic Power Manager. 0 means full framerate (no throttling); larger values drop more frames. DPM reports 0 when unthrottled and values of 3 or greater when throttling (1 and 2 are not emitted).

Since

Lens Scripting Version 387


mode

readonly mode: ThrottleMode

SPECS onlySPECS

The current throttle level.

Since

Lens Scripting Version 387

Methods

getTypeName()

static getTypeName(): TypeName<ThrottleState>

SPECS onlySPECS

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

Since

Lens Scripting Version 387

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.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

ScriptObject.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

ScriptObject.isSame