Log inGet started
World

Press Start Studio: Title, Pause, Settings and Credits Menus

README.md

GalleryBrowser

The showcase browser for menusKit. It sits on the gallery scene's gallery entity, and nothing else in the scene needs it. It is not part of the package. It is ordinary game code that drives the kit through public calls only, so it doubles as a worked example.

What it does:

  • Opens every menusKit screen with demo data: title, pause, settings, game over, victory, loading (with tips and a moving progress bar) and credits. It steps through every look and layout, and one Menus.setTheme or Menus.setLayout call restyles all of them.
  • Draws a labelled bar across the top with Look, Screen and Layout steppers, the current look's tags (mood, genre, best input), and a Walk button. Every menu stays clear of the bar through Menus.setup{ insets = { top = barHeight } }. The bar rearranges itself into two rows on a portrait phone.
  • Walk hides the menus and gives the character back to the player. Escape, Start or the touch pause button then pauses only that player, while the world and everyone else keep going. Browse menus returns to the browser.
  • Puts all of its own text (the bar, toasts, tips, credits) in English, Brazilian Portuguese and Spanish, and follows the language picked in the kit's settings.

Needs: the menusKit and controlsKit packages at /source, and the gallery.galleryKeys input map next to it. For walking, the player body needs controlsKit.ControlsMover. The browser switches on a copy of controlsKit's platformer scheme, registered as galleryWalk without its corner pause button, so a phone shows a single pause button: menusKit's.

It also holds the gallery.galleryWalk input map (it suppresses player and has one empty binding) for as long as it runs. controlsKit keeps its own takeover claim in module state, which outlives an editor Play → Edit → Play, while the engine drops the claim itself when play stops. Without a claim of our own, the builtin Sprint/Jump/stick touch controls would come back over controlsKit's on a second play. Both claims, the scheme and the map, are released in onDestroy.

Keys (from gallery.galleryKeys):

KeyboardGamepadTouch
Previous / next look1 / 2LT / RTthe Look arrows
Previous / next screen3 / 4none / Selectthe Screen arrows
Previous / next layout5 / 6none / R3the Layout arrows
Walk / browseML3the Walk / Browse menus buttons

No public fields.