API Reference - Lens Simulator

List of all the existing methods and parameters of the Lens Simulator module

Instance methods

restoreLensDefaultMaterial(): void
Unapplies a lens material and restores the original lens for the current frames displayed in VTO.

setExposureLevel(level: number): void
Sets the exposure level for photochromic lenses.
`level` is a numerical value between 0 and 100.

setLensMaterial(material: string): void
Applies a lens material on the current frames displayed in VTO.
material is the SKU identifier of the material to apply.

Instantiation parameters

materials: object
Pre-loads a list of materials and displays a generic material selection toolbar in the VTO.
The value is an object with the following structure: 

  materials: [
{ id: 'SKU', name: 'COLOR NAME', image: 'URL_TO_IMAGE_OF_MATERIAL' },
  { id: 'SKU', name: 'COLOR NAME', image: 'URL_TO_IMAGE_OF_MATERIAL' },
...
]

Default lenses

The following SKUs are default tinted lenses available for everyone:

  • Simple colors:
    • Sample_Black
    • Sample_Blue
    • Sample_Brown
    • Sample_Green
    • Sample_Grey
    • Sample_Purple
  • Metallic mirror-like colors:
    • Sample_MirrorBlack
    • Sample_MirrorBrown
    • Sample_MirrorGreen
    • Sample_MirrorGrey
    • Sample_MirrorGreyBrown
    • Sample_MirrorPurple
  • Photochromatic colors:
    • Sample_PhotochromaticBrown
    • Sample_PhotochromaticGreen
    • Sample_PhotochromaticGrey

Example