December 2018, updated July 2021
SNAPCHAT AR: LENS STUDIO KEYBOARD
Since there is no built-in keyboard feature in Lens Studio yet, I made this as a temporary workaround.
No programming is required to use the Keyboard, but it is possible to call certain functions
to interact with the keyboard through your own scripts (the list of features is at the end of this page).
The keyboard supports single-line and multi-line text, with as many lines as you’d like.
There is a SHIFT button for capitals, and there are two more panels for symbols and numbers:
And it has some customization options:
To get the text typed by the user on a Text component, add the ‘Get Keyboard Text’-script to an object.
To quickly change the look of the keys, edit the ‘Keyboard Keys’ material.
This material takes care of the toggle, space bar, and normal keys, in both states: pressed and idle.
To set a default text (and optional multi-line count), type it in the ‘Default Text Lines’ textbox in the Keyboard settings.
– Get the first line of text as a string (function, optional int argument to specify which line if multiline)
global.keyboard.getLine() – reads first line of text (default)
global.keyboard.getLine(1) – reads second line of text
– Check if keyboard is currently visible (bool)
– Toggle keyboard in/out animation (function)
– Get or set keyboard out text lines (array)
– Get the current line the user is typing in (Number)
– Check if the user is currently in the Symbols tab (bool)
– Check if the user is currently using Caps Lock (bool)