Auto Picker UI (More Than 10) - Script for Meta Spark AR Studio
This is a script that you can put more than 10 options (tested with up to 500 options) in Native UI Picker automatically.
After configuring the script, you just need to insert the textures in your project and use the "pickerui_" prefix in the name of the textures that the script automatically recognizes and already assembles your Native UI Picker with the inserted textures.
And there is also another advantage which is the use of persistence, which saves the last option chosen by the user. So every time the user closes and opens the filter, it automatically returns to the last option chosen.
Steps to configure the script in your project:
ENABLE CAPABILITIES
Project -> Edit Properties... -> Capabilities -> Native UI Control -> Picker
CONFIGURE SCRIPT VARIABLE
From Script -> uipicker_selected (type Number)
CONFIGURE OPTION TEXTURES
- Disable compression for all option textures.
- Rename textures with prefix: pickerui_
- Use a numeric sequence for texture names for sorting.
e.g.: pickerui_opt001, pickerui_opt002, pickerui_opt003...
Example of Obfuscated Script
It doesn't change anything in the execution of the filter, but the script code is obfuscated and difficult to read, which makes the project cheaper.
Example Readable Script
It's the same function as the obfuscated option, but the script code is fully formatted and easy to read. Ideal for other script developers or anyone just learning and wanting to know how the full code works.
1 Project demo file .arprojpkg, 1 script in javascript