menuBack
The one module of menuBackKit. `hold(onBack, opts)` takes Back for an open menu: while the hold stands, Escape, a gamepad's Start or B and a phone's back gesture run `onBack`, newest and highest hold first, and the app's pause menu stays shut. `hold:release()` gives it up. `follo…
menuBack
The one module of menuBackKit. hold(onBack, opts) takes Back for an open menu: while the hold stands, Escape, a gamepad's Start or B and a phone's back gesture run onBack, newest and highest hold first, and the app's pause menu stays shut. hold:release() gives it up. follow(key, isOpen, onBack) keeps a hold by a menu's own open test, for a menu from another kit. count(), labels() and keysUp() say what stands. Called by any kit or game that draws its own menus.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2nonstrict
backKeyHeld( ) → boolean
whether a key that closes a menu (Escape, a pad's Start or B) is down on any device right now
topHold( ) → any
the hold Escape and Start close: the highest priority, and the newest among equals
mapUp( ) → void
mapDown( ) → void
drop(h: any) → void
| arg | type | description |
|---|---|---|
| h | any |
hold(onBack: () → void
Hold Back for an open menu: while held, Escape, a pad's Start or B and a phone's back gesture run `onBack` (the topmost, most recent hold first) and the app's pause menu stays shut. opts: { priority (default M.PRIORITY), label }. Returns a hold: `hold:release()` gives it up (call it when the menu closes; `onBack` closing the menu should release it too), `hold:held()` says whether it still stands.
| arg | type | description |
|---|---|---|
| onBack | ( |
release(self: any) → boolean return drop
| arg | type | description |
|---|---|---|
| self | any |
held(self: any) → boolean return table
| arg | type | description |
|---|---|---|
| self | any |
count( ) → number return
How many holds stand now (menus the game has open that Back closes first).
labels( ) → void
The labels of the holds standing, oldest first.
keysUp( ) → boolean return S
Whether the backKeys map is up (the app menu's Escape and Start stood down).
follow(key: string, isOpen: boolean, onBack: () → void
Keep a hold while `isOpen()` reads true: call every frame with the menu's own open test and how to close it. The hold is taken when it opens and released when it closes, however it closed. Returns the hold or nil. For a menu from a kit that does not hold Back itself (a bag, a build mode).
| arg | type | description |
|---|---|---|
| key | string | |
| isOpen | boolean | |
| onBack | ( |
releaseAll( ) → void
Release every hold (tests, a game resetting its UI).
_presses( ) → number return S
Tests: how many Escape / Start presses the kit turned into Back.
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.