Log inGet started
Package

app_menu.module

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

appMenu

The app's menu: the one menu the pause action opens, in every profile and on every platform. The pause action is Escape, a gamepad's Start, the on-screen Menu button on a touch screen (inputMaps/app.inputMap), and the left controller's menu button in a headset. Pressing it again goes back one step inside the tab on screen, and closes the menu from the tab's first step. Opening the menu pauses nothing: every world is shared, and keeps running.

Tabs

The menu is a host of tabs, and every tab is a .menuTab asset (assetTypes/menuTab.assetType):

  • World, the world's own tab: the .menuTab in the world's /source. A new world starts with menuTabs/game.menuTab to rewrite; a world with none shows its title, Resume and the way to another world.
  • ZeroMind (menuTabs/zeromind.menuTab): the worlds to play and make, search, and every world, part and creator page (launcher).
  • System (menuTabs/system.menuTab): the client settings, each group a section, VR among them in a headset (clientSettings).

A tab asset in another library, or in the dependency tree of a world installed into this one, adds nothing.

Presentations

The menu draws a frame around the tab on screen, laid out for the device (appMenu.presentation()):

  • desktop: full-window, the brand and the tabs across the top beside Resume and Enter VR;
  • phone (Android, or a screen narrower than a tablet): full-screen, a header naming the tab over the body and the tabs along the bottom, within thumb reach;
  • vr: a home menu on a curved world panel at arm's reach, Resume, Recenter and Exit VR along its top and the tabs along its bottom edge, sized for a laser or a pinch. A standalone headset app, which has no window to return to (xr.returnsToFlat()), offers Quit in place of Exit VR, ending the app as the headset's own Quit does.

A tab's build(ctx) draws its body for ctx.presentation in the room ctx.width x ctx.height the frame leaves it.

Reaching it

appMenu.open(tab?), appMenu.close(), appMenu.toggle() (what the pause action does), appMenu.select(tab), appMenu.isOpen(), appMenu.activeTab() and appMenu.tabs().