Changelog
World screens: a screen drawn on a prop in the game world.
<screen surface="world" size="1280x720" />makes a screen one that is drawn on a texture of the game, such as the screen of a monitor, by a browser of that size. A resource may have any number of them, from the same build as its page and its apps.Nexus.world(name, { txd, texture, props })in client Lua creates a display of it and returns it, orniland'unavailable','limit'or'taken'.display:set(props),display:destroy()anddisplay:alive()manage it. A resource has four displays at a time unless the convarnexus_world_limitsays otherwise, and all of them are destroyed when it stops.- Input.
display:pointer,press,release,scroll,typeandkeydrive a display from Lua. The page draws its own cursor and turns typed text and keys into edits of the focused field and intokeydownevents foronKey.Nexus.operate(display, { entity, camera, onExit })hands the display to the player with a camera in front of it, andNexus.release()takes it back. - The bridge reaches a display like any page. A call is answered to the display that made it, and pushes, state and the locale go to every display.
nexus devhas a button for each world screen and shows it in a frame of its size, with the keyboard sent the way a display receives it. The mock takesworlds: { name: { props } }. With--game, a display loads its page from the dev server.nexus checkandnexus buildreport a world screen without asizeor with focus attributes, aNexus.openof one, and aNexus.worldof a screen that is not one.examples/worldis a resource that proves the chain in game:/worldtestreports each step.- What world screens need in the page is a file of its own, loaded by a display and by a page that forwards input. The runtime of a resource without them is the size it was.
World screens have been tested in Chromium 103 and in Lua, and not yet inside the game. The roadmap says what that leaves open, and lists their limits.
Nothing changes for a resource that has no world screen. To move one from 0.2.2, install
@nexusstudios/ui@^0.3.0 and build again, which also brings the new nexus/client.lua.
Nexus.operatetakesscreen: where the screen is on its entity. The game’s cursor then points at the prop’s screen itself and acts only while it is over it.
- The package is on npm, as
@nexusstudios/ui.npm create nexus-ui my_shopstarts a resource, andnpm install --save-dev @nexusstudios/uiadds the package to one that exists. - A new resource depends on
@nexusstudios/uiby version (^0.2.2), not on the address of a release file. To move an existing resource over: removenexus-uifrom itspackage.json, runnpm install --save-dev @nexusstudios/ui, and changenexus-uito@nexusstudios/uiinvite.config.tsand in the twopathsoftsconfig.json. Imports fromnexusandnexus/contractstay as they are. - The release file is still attached to every GitHub release, for work without the registry.
Fixes found by the first resources that built phone and tablet apps on 0.2.0.
- A call inside an effect no longer loops.
nui.callread the counter behindnui.pendingwhile changing it, so an effect that made a call ran again when the answer arrived, until the cycle guard stopped it.untrackaround the call is no longer needed. nexus devwith a phone app and a tablet app. Showing one of them threwCannot read properties of null (reading 'style')and left the frame without a size.nexus devstops with the task runner that started it. It watched three processes above itself. With a shim and a shell in between, what was ended sat higher, and the server stayed on its port. It watches five now.- Docs: how an app loads fresh data when LB Phone shows it again, the root font size LB gives
an app (
remis larger in the tablet), that a call withoutoutputreturns nothing, and the names of the app buttons in the dev bar.
To move a resource from 0.2.0, change the version in the address of nexus-ui in its
package.json (it appears twice) and run npm install.
The first public release.
.nexuscomponents compiled to direct DOM updates.- A typed contract: calls, pushes, client messages, state and screen props, with the Lua validators and rate limits generated from it.
- Screens that Lua opens by name, with focus and Escape declared in the file.
- Apps for LB Phone and LB Tablet from the same build (
<screen surface>,Nexus.app). - The
nexuscommand:create,dev,build,check.