Skip to main content

SpecsInteractionModule.CursorVisualState

Class

Cursor visual state, passed to SpecsInteractionModule.Interactor#setCursorVisualState.

  • Snapchat: not supported
  • SPECS: fully supported
  • Camera Kit Web: not supported
  • Camera Kit Mobile: not supported
  • SnapchatNot supported — Available on SPECS only
  • SPECSFully supported
  • Camera Kit WebNot supported — Available on SPECS only
  • Camera Kit MobileNot supported — Available on SPECS only

Platform details

  • Snapchat — Not supported — Available on SPECS only.

  • SPECS — Fully supported.

  • Camera Kit Web — Not supported — Available on SPECS only.

  • Camera Kit Mobile — Not supported — Available on SPECS only.

Since Lens Scripting v375

Cursor visual state, passed to SpecsInteractionModule.Interactor#setCursorVisualState. A default-constructed instance (Auto mode, no hold, all flags false) clears any state previously set for the interactor.

Index

Example

// Reuse one instance across frames; mutate and resubmit while a hold is in flight.
const cursorState = new SpecsInteractionModule.CursorVisualState();
cursorState.holdProgress = 0.5; // half-way through an 800ms long-press
cursorState.holdThresholdMs = 800;
interactor.setCursorVisualState(cursorState);

Constructors

Constructor

new CursorVisualState(): CursorVisualState

Returns

CursorVisualState

Properties

holdProgress

holdProgress: number

SPECS

Long-press hold progress that drives the timer arc, in the range [0, 1]. Leave at 0 when no hold is in flight.

Since

Lens Scripting Version 375

Default Value

0
@snapOS

holdThresholdMs

holdThresholdMs: number

SPECS

Duration of the long-press hold in milliseconds. Only meaningful when holdProgress is greater than 0.

Since

Lens Scripting Version 375

Default Value

0
@snapOS

mode

mode: CursorVisualMode

SPECS

Names the manipulation in progress so the cursor can show matching artwork.

Since

Lens Scripting Version 375

Default Value

SpecsInteractionModule.CursorVisualMode.Auto
@snapOS

nearField

nearField: boolean

SPECS

Whether the interactor is in near-field range.

Since

Lens Scripting Version 375

Default Value

false
@snapOS

poking

poking: boolean

SPECS

Whether the interactor is poking.

Since

Lens Scripting Version 375

Default Value

false
@snapOS

secondaryTriggering

secondaryTriggering: boolean

SPECS

Whether a secondary trigger is currently engaged.

Since

Lens Scripting Version 375

Default Value

false
@snapOS

Methods

getTypeName()

static getTypeName(): TypeName<CursorVisualState>

SPECS

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

Since

Lens Scripting Version 375