Thumbstick Studio: Touch, Gamepad and Keyboard Controls Kit
README.md
controlsKit.gallery
The showcase screen behind ControlsGallery and scenes/gallery. It shows every control scheme (Controls.schemes(), one card each: label, the engine map(s) it stands on, every action with a keyboard and a pad chip, Try it), every stick, button layout, gesture area (tilt marked not supported), prompt family x style and look, labelled, all lit by the same input: keys, a pad or touches on any control.
It fits itself to the screen: M.layout(w, h, { safe }) (pure) flows each section (M.sections(): the schemes, then M.SECTIONS) into a grid in logical points and, when everything can't fit with every label at least M.MIN_TEXT (11) points, splits the sections over pages. Scheme cards come in two shapes, a one-column "tall" card and a two-column "wide" one, whichever needs fewer pages. A short section sits beside an earlier one when there is room. Pages are picked with big (44 pt) tabs, or Prev / Next on narrow screens, by touch or click; with Tab / Shift+Tab or PageUp / PageDown; or with LT / RT on a pad. A 1920x1080 screen is one page, 1280x720 three (Schemes; Sticks, Buttons and Gestures; Prompts and Looks), phones 9-13.
Every page carries two 44 pt buttons (layout.actions): Walk around (g:setMode("walk"): the panel comes down, the touch controls show, and only a Gallery button is drawn, placed by the pure M.walkButton(w, h, safe, placed) clear of the touch controls) and Rebind controls (g:openRebind(); the host's onCallback must forward to rebindScreen.handle). While the rebinding screen is open the panel takes no clicks, touches or keys, and pause (Escape / Start) closes it. Clicking or touching a scheme card calls g:useScheme(name).
new({ scheme, preview?, headless? }), tick(dt), snapshot() (lit state plus page / pages), locate(kind, name) (logical point of a control; turns to its page), toScreen (identity now), setPage(p), pageInfo(), setMode(mode) / g.mode, useScheme(name), openRebind(), hitAt(x, y), destroy(); M.active(), M.walking(), M.schemeCard(name). preview = true is a still picture that never touches the live controls (used in edit mode); headless = true draws nothing on screen and commands(layout, page) returns the draw list (used by the tests). The live gallery draws at layer 55, under the rebinding screen (60). M.WIDTH / M.HEIGHT are the desktop size it was tuned on, no longer a design space.