Created
March 14, 2019 17:11
-
-
Save thelucre/422c8a83660ccb767d9875bdf92c11b2 to your computer and use it in GitHub Desktop.
Count the number of eyebrow raises in Snapchat Lens Studio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -----JS CODE----- | |
var highBrowCount = 0; | |
/** | |
* BrowsRaisedEvent, triggered when the user's brows change to raised. | |
* LensStudio does all of this detection for us, we just listen for the event. | |
* @param {BrowsRaisedEvent} ev | |
*/ | |
// Callback for the BrowsRaisedEvent | |
function onBrowsRaised(ev) { | |
print( | |
"My, what high brows you have! Brows raised " + (++highBrowCount) + " times." | |
); | |
} | |
// Binding our callback to the BrowsRaisedEvent | |
var browsRaisedEvent = script.createEvent("BrowsRaisedEvent"); | |
browsRaisedEvent.bind(onBrowsRaised); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment