Skip to main content

HintsComponent

Class

Used to display text hints in a Lens.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Index

Remarks

If you only need to show one hint on Lens start up, you can configure your project to display the hint without scripting it.

Hint IDHint Message
"lens_hint_blow_a_kiss""Blow A Kiss"
"lens_hint_come_closer""Come Closer"
"lens_hint_do_not_smile""Do Not Smile"
"lens_hint_do_not_try_with_a_friend""Do Not Try With A Friend"
"lens_hint_find_face""Find Face"
"lens_hint_keep_raising_your_eyebrows""Keep Raising Your Eyebrows"
"lens_hint_kiss""Kiss"
"lens_hint_kiss_again""Kiss Again"
"lens_hint_look_around""Look Around"
"lens_hint_look_down""Look Down"
"lens_hint_look_left""Look Left"
"lens_hint_look_right""Look Right"
"lens_hint_look_up""Look Up"
"lens_hint_make_some_noise""Make Some Noise!"
"lens_hint_nod_your_head""Nod Your Head"
"lens_hint_now_kiss""Now Kiss"
"lens_hint_now_open_your_mouth""Now Open Your Mouth"
"lens_hint_now_raise_your_eyebrows""Now Raise Your Eyebrows"
"lens_hint_now_smile""Now Smile"
"lens_hint_open_your_mouth""Open Your Mouth"
"lens_hint_open_your_mouth_again""Open Your Mouth Again"
"lens_hint_raise_eyebrows_or_open_mouth""Raise Your Eyebrows / Or / Open Your Mouth"
"lens_hint_raise_your_eyebrows""Raise Your Eyebrows"
"lens_hint_raise_your_eyebrows_again""Raise Your Eyebrows Again"
"lens_hint_smile""Smile"
"lens_hint_smile_again""Smile Again"
"lens_hint_swap_camera""Swap Camera"
"lens_hint_tap""Tap!"
"lens_hint_tap_a_surface""Tap A Surface"
"lens_hint_tap_ground""Tap The Ground"
"lens_hint_tap_ground_to_place""Tap Ground To Place"
"lens_hint_tap_surface_to_place""Tap Surface To Place"
"lens_hint_try_friend""Try It With A Friend"
"lens_hint_try_rear_camera""Try It With Your Rear Camera"
"lens_hint_turn_around""Turn Around"
"lens_hint_walk_through_the_door""Walk Through The Door"

Example

// Create the hints component
var hintsComponent = script.getSceneObject().createComponent(HintsComponent.getTypeName());

// Show "Smile" hint
hintsComponent.showHint("lens_hint_smile", -1);

// Wait for smile...
script.createEvent("SmileStartedEvent").bind(function()
{
// Hide the "Smile" hint
hintsComponent.hideHint("lens_hint_smile");
});

Extends

Properties

enabled

enabled: boolean

If disabled, the Component will stop enacting its behavior.

Default Value

true

Inherited from

Component.enabled


isBeingDestroyed

readonly isBeingDestroyed: boolean

Returns true if this Component is currently being destroyed. Becomes true as soon as destruction begins via Component#destroy or destruction of its owning SceneObject, before any OnDestroyEvent callbacks fire.

Since

Lens Scripting Version 364

Example

if (!script.isBeingDestroyed) {
// Component is still fully alive
}

Inherited from

Component.isBeingDestroyed


isEnabledInHierarchy

readonly isEnabledInHierarchy: boolean

Returns true if this Component, its SceneObject, and all of that SceneObjects parents are enabled.

Inherited from

Component.isEnabledInHierarchy


sceneObject

readonly sceneObject: SceneObject

The SceneObject this component is on.

Inherited from

Component.sceneObject


uniqueIdentifier

readonly uniqueIdentifier: string

Since

Lens Scripting Version 176

Inherited from

Component.uniqueIdentifier

Methods

destroy()

destroy(): void

Destroys the component.

Returns

void

Inherited from

Component.destroy


getSceneObject()

getSceneObject(): SceneObject

Returns the SceneObject the component is attached to.

Returns

SceneObject

Inherited from

Component.getSceneObject


getTransform()

getTransform(): Transform

Returns the Transform this component is attached to.

Returns

Transform

Inherited from

Component.getTransform


getTypeName()

static getTypeName(): TypeName<HintsComponent>

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

Overrides

Component.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

Component.getTypeName


hideHint()

hideHint(hintID): boolean

Hides the hint with id hintID.

Parameters

ParameterType
hintIDstring

Returns

boolean


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

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

Component.isSame


showHint()

showHint(hintID, duration): boolean

Shows the hint with id hintID for a duration of duration seconds. Use a duration of -1 to keep the hint onscreen forever.

Parameters

ParameterType
hintIDstring
durationnumber

Returns

boolean

See also

Scripting Hints Guide.