Repository navigation
v0.23.0
ge::Button + ge::ButtonGroup — standard touch-button interactor
iOS-style press semantics, rendering-agnostic. Replaces inline button hit-testing across ge consumers.
Added
ge::Button(<ge/button.h>) — Press-button state machine. Tap down inside the hit region highlights, drag outside un-highlights, drag back in re-highlights, release inside fires, release outside (or externalcancel()) doesn't. Consumer supplies ahitTestpredicate (rect, SVG element vialunasvg::Document::elementFromPoint, polygon, anything) and querieshighlighted()from the render loop.tracking()reports whether a press is in flight.onFire/onHighlightChangecallbacks for action triggers and one-shot side effects.ge::ButtonGroup(<ge/button.h>) — Borrows astd::vector<Button*>and routesPointerEvents with single-button-lock semantics: once a button claims a touch, all subsequent events for any finger are routed to it until it returns to idle. Single-touch by design — additional fingers are ignored.ge::PointerEvent(<ge/button.h>) — Tiny pre-converted struct ({kind, pos, id}). Consumer convertsSDL_Event → PointerEventonce at the dispatch site (mouse usesge::kMouseIdsentinel; touch copiesSDL_TouchFingerEvent::fingerID). Keeps the engine out of the coord-space conversion business — consumer's pixel space stays authoritative.ge::rectHitTest(Rect)— Convenience helper for the most common case. For dynamic rects, reassign per frame or write the lambda inline.
Why pre-converted PointerEvent instead of SDL_Event?
Touch events report normalized (0..1) coords; mouse events report pixel coords. The engine can't convert without knowing the consumer's surface size, and consumers like multimaze already do this conversion at their dispatch site. Pre-converted PointerEvent keeps that conversion exactly once at the consumer's chosen boundary.
Migration
Consumers replace inline button-hit-test + state-tracking with a ge::Button or ge::ButtonGroup. For multimaze specifically, this subsumes the TopBar::dispatchTap logic and the menu button hit-testing in Application.cpp. The migration happens post-release in multimaze's repo.