UI Keyboard Numeric
Updated
On-screen number keypad.
- Type
comp-ui-keyboard-numeric- Script class
UIKeyboardNumericComponent- Per entity
- One
- Version
- 1.1.0
Read about it in Controls: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
margin |
||
margin[] |
- |
|
opacity |
0 ≤ x ≤ 1 |
|
padding |
||
padding[] |
0 ≤ x ≤ 16384 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
UIKeyboard::pressUIKeyboard::showUIKeyboard::hide
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
A keypad that opens a vaultA numeric UI Keyboard placed in the scene types into a number field; a Behavior script checks the code on submit and swings the vault door open with a tween.
Click the code field, then press 2, 4, 6, 8 and the enter key on the in-scene keypad. A wrong code clears the field. Drag outside the panel to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(UIKeyboardNumericComponent); if (component) log(component.props);}