Examples
Four ready-made widgets to place, play and copy from - settings, a shop, a code keypad and a radio.
The kit ships four example widgets in WorldUIKit/Widgets, each with its layout and logic in a Verse file of the kit
folder. They are built like screen UIs: every control is a Custom Button, so the online editor
and the AI skill find them, and they show every state themselves from their fields.
To place one: drag its WBP into the level (scale 10, facing the players), select it, and add
interactive_widget_component and its two components, world_ui_kit_<name>_layout and world_ui_kit_<name>_logic.
| Example | WBP | Components | States |
|---|---|---|---|
| Settings | WBP_WorldUIKit_Demo | world_ui_kit_demo_layout, world_ui_kit_demo_logic | Shared |
| Shop | WBP_WorldUIKit_Shop | world_ui_kit_shop_layout, world_ui_kit_shop_logic | PerPlayer |
| Keypad | WBP_WorldUIKit_Keypad | world_ui_kit_keypad_layout, world_ui_kit_keypad_logic | Shared |
| Radio | WBP_WorldUIKit_Radio | world_ui_kit_radio_layout, world_ui_kit_radio_logic | Shared |
Settings
A settings panel: a Music toggle, three Difficulty choices, a Volume slider with − and + steppers, Play and Reset. It is the widget of the quick start.
- Fields:
<Name>Hoveron every control,<Name>Pressedon the steppers, Play and Reset,<Name>Onon Music and the choices,VolumeFillon the Width Override of the fill bar's SizeBox,VolumeTexton the value text. - Settings: none.
- To copy: state layers shown by Render Opacity; a fill bar driven by
<Name>Fill; Reset written withSetOnandSetValue, for the player who clicked (?Player := option{Event.Player}).
Shop
A shop with two tabs: Items (buy a blade, a shield or a potion) and Skins (pick a skin, then Equip). Each
player has their own tab, gold and skin: set States to PerPlayer on interactive_widget_component. The layout makes
per-player copies (NewCopy), so each player sees their own copy of the widget.
- Fields: hover on every control, pressed on the buy buttons and Equip, on for the tabs and skins;
Screen(int) on the Active Widget Index of the WidgetSwitcher that holds the two pages;Gold(int, on a text) andMessage(message), written by the logic itself. - Settings:
StartGoldonworld_ui_kit_shop_logic(100). - To copy:
- tabs that switch a WidgetSwitcher through the
Screenfield; - per-player data in the logic (a
[player]intmap) shown on the player's own copy withWidgetFor:
- tabs that switch a WidgetSwitcher through the
Show(Kit:interactive_widget_component, Who:player, Text:string):void =
if (W := Widgets.WBP_WorldUIKit_Shop_entity[Kit.WidgetFor(?Player := option{Who})]):
set W.Gold = GoldOf(Who)
set W.Message = InteractiveText(Text)- the gold appears the first time a player aims at the shop (
SubscribeHovered); IsOn["SkinRed", ?Player := option{Who}]reads the skin that player selected.
Keypad
A code lock everyone shares: twelve keys, the typed code shown as stars, a light that turns green when the code is right, a red flash when it is wrong.
- Fields: hover and pressed on every key;
Code(message, the stars),Unlocked(float, the light) andError(float, the red flash), written by the logic on the placed widget (WidgetFor()without a player). - Settings:
Code("1234") andUnlockSeconds(3) onworld_ui_kit_keypad_logic. - To copy:
UnlockedEvent, anevent(player)of the logic component, signalled with the player who typed the right code. Another component can wait for it to open a door:
if (Keypad := Entity.GetComponent[world_ui_kit_keypad_logic]):
Who := Keypad.UnlockedEvent.Await()A token cancels the pending relock when a new code is entered.
Radio
A shared music player: Prev and Next, a Play / pause toggle, a vertical Volume slider and the name of the track.
- Fields: hover on every control, pressed on Prev and Next;
PlayOnon two widgets: the opaque On layer that hides the PLAY label, and the PAUSE label above it;VolumeFillon the Height Override of the fill's SizeBox (a vertical slider fills upwards);VolumeText;Track(message), written by the logic. - Settings:
Tracksonworld_ui_kit_radio_logic(three names). - To copy: one field that swaps two labels; a vertical slider; a text written when the round starts
(
SubscribeRoundStarted) and on each skip.
Your own widgets
The examples are references: copy their WBP to start yours, or read their Verse file to see a layout generated by the editor and a logic written by hand. Never edit the kit's own files: an update replaces them.