Represents the AlloApp.
Mediates communication with backend, and maintains the runloop. Create one of these, configure it, connect it and run it, and you have an alloapp.
local app = App(client)
|client||Client||The AlloNet client wrapper|
Open a ui.View as a popup near a hand. Call from e g a button handler to display it right where the user could easily interact with it. You can use this to open a “new item” or a “settings” UI near a user. Since apps are multi-user, sometimes it’s nice to give a user some personal UI that they can do input in, so that they don’t have to fight over control of input with another user.
|popup||ui.View||The view to show to the user. It will be instantiated in|
|the world at the appropriate location.|
|hand||Entity||The hand entity that the popup should be shown near.|
|In a button handler, this is the first argument to the callback.|
|distance||number||The distance in meters from the hand to show. Default 0.6|
|entity||Callback(view,||) cb The callback to call when the popup is present in-world|
Add a widget to the user’s left wrist, and arrange it to fit with the other widgets already present. Use this to provide some portable UI to the user, such as a remote control.
| Name | Type | Description | | ———— | ————– | ————— | | avatarOrHand | Entity | The avatar of the user to add the widget to. Can also be any child entity to the avatar, such as a hand, and the avatar will be looked up for you. | | widget | ui.View | The widget to add. Must be at most 3cm wide. You can make it a button or something that opens more UI nearby if you need more space. | | callback | Callback(bool) | Callback for when adding widget finishes. Its argument is true if successful. |
Schedule work to be done later
|delay||number||The time (in seconds) until the callback is called.|
|repeats||boolean||Whether The callback should repeat (with the same delay) or only occur once.|
|callback||function||The function to be called (with no arguments).|
Current client time. This is monotonically increasing.
Current server time. Might jump around a little to compensate for lag.