Skip to content
English
  • There are no suggestions because the search field is empty.

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_lens_black Sample_Black
sample_lens_blue Sample_Blue
sample_lens_brown Sample_Brown
sample_lens_green Sample_Green
sample_lens_grey Sample_Grey
sample_lens_purple Sample_Purple

Metallic mirror-like colors

sample_lens_mirrorblack Sample_MirrorBlack
sample_lens_mirrorbrown Sample_MirrorBrown
sample_lens_mirrorgreen Sample_MirrorGreen
sample_lens_mirrorgrey Sample_MirrorGrey
sample_lens_mirrorgreybrown Sample_MirrorGreyBrown
sample_lens_mirrorpurple Sample_MirrorPurple

Photochromatic colors

sample_lens_photochromaticbrown Sample_PhotochromaticBrown
sample_lens_photochromaticgreen Sample_PhotochromaticGreen
sample_lens_photochromaticgrey Sample_PhotochromaticGrey

Example