Sorting
Adds a game where you drag your friends into roles, for example BFF or Nemesis. Name two to six roles, or sort up to six pictures of your own instead.
Asset stores, saved data, and the core building blocks behind bigger experiences.
Made with this blockInputs
titlestringThe text displayed above the sorting interface. It should be short and concise, ideally no more than 20 characters. For example: "My Team".
sortingTypeintDefines the sorting mode. Accepts only two values: - 0: Sorts friends - 1: Sorts custom items By default, the component uses friend sorting. Set to 1 only if custom item sorting is explicitly required.
roleNamesstringAn array of 2 to 6 strings representing the role labels displayed above the sorting cells. These names define the categories users will sort items into (e.g., "BFF", "CRUSH", "NEMESIS", "SIDEKICK"). Make sure to provide at least 2 and no more than 6 role names. By default, use 4 role names, unless the user explicitly requests a different number.
allowRetriesbooleanDefines whether the user can restart the sorting experience after assigning all roles. If true: The user will see a restart button and can reassign roles. If false: The experience ends after the initial sorting. Only set to true if the user explicitly asks to allow retries.
itemLabel1stringLabel of the first custom item. Used only when sortingType is set to 1.
itemLabel2stringLabel of the second custom item. Used only when sortingType is set to 1.
itemLabel3stringLabel of the third custom item. Used only when sortingType is set to 1.
itemLabel4stringLabel of the fourth custom item. Used only when sortingType is set to 1.
itemLabel5stringLabel of the fifth custom item. Used only when sortingType is set to 1.
itemLabel6stringLabel of the sixth custom item. Used only when sortingType is set to 1.
itemIcon1textureIcon for the first custom item. Used only when sortingType is set to 1.
itemIcon2textureIcon for the second custom item. Used only when sortingType is set to 1.
itemIcon3textureIcon for the third custom item. Used only when sortingType is set to 1.
itemIcon4textureIcon for the fourth custom item. Used only when sortingType is set to 1.
itemIcon5textureIcon for the fifth custom item. Used only when sortingType is set to 1.
itemIcon6textureIcon for the sixth custom item. Used only when sortingType is set to 1.
Events
onSortingStartedA function called when the sorting has started, allowing the experience to respond to this event. Call it through .onQuizStarted.add(()=>{Your code here});
onSortingFinishedA function called when the sorting has finished ( when the user has assigned all roles), allowing the experience to respond to this event. Call it through .onSortingFinished.add(()=>{Your code here});
onRoleSetA function called when a role has been assigned, allowing the experience to respond to this event. Call it through .onRoleSet.add(()=>{Your code here});
More in Utilities & Storage
- Canvas APIDraws the 2D graphics a game needs, such as a game board, a health bar or puzzle pieces. Ask for a 2D game or a sliding puzzle.
- Core3DBuilds the 3D scene for a game, with objects that move, collide and fall. Ask for a 3D game, for example bowling or a maze you roll a ball through.
- Model StoreHolds up to ten 3D models under names you pick, so other parts of the Lens can find each one. It shows nothing on the screen by itself.
- Persistent StorageSaves small amounts of information on your device, so the Lens remembers it next time you open it. Use it for your settings, your progress or your own best score.
- Sprite StoreHolds up to ten pictures that a 2D game uses, such as characters, cars or enemies. It also holds a photo or video you add yourself.
- Texture StoreHolds up to ten pictures under names you pick, so other parts of the Lens can find each one. It shows nothing on the screen by itself.
