Scene2D actors and platform accessibility services: where should widget roles, labels, and focus order live in a libgdx game?
0 reputation · 07 Apr 2021, 11:51 UTC
0 reputation · 07 Apr 2021, 11:51 UTC
I'm designing the UI layer of a libgdx game built on Scene2D (labels, text buttons, sliders, and a few custom actors rendered with textures). I want the user-facing workflow to be usable with screen readers and keyboard/controller focus navigation across Android, iOS, desktop, and GWT backends.
My understanding is that libgdx has no unified, backend-neutral accessibility API for Scene2D: Android exposes a mature accessibility model, desktop and iOS differ, and GWT renders to canvas, which the browser cannot interpret semantically on its own. So any accessible name, role, state, or focus order has to be modeled on my side and translated per backend.
The unresolved design decision is where that metadata should live. Option A: attach role/label/state data to Scene2D actors and write per-backend adapters that publish it to the OS. Option B: keep Scene2D purely visual and maintain a parallel accessibility tree at the application layer that mirrors the scene graph and forwards focus and change events.
Questions:
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.