ThrottleState
ClassA 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
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
Properties
Methods
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
readonlyframeFactor: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
readonlymode:ThrottleMode
SPECS onlySPECS
The current throttle level.
Since
Lens Scripting Version 387
Methods
getTypeName()
staticgetTypeName():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
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