Add screen reader accessibility guidance and framework-level helpers
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- javascript
調査の方向性
まず、dom.createContainer と canvas/WebGL のアクセシビリティ上の制限を通して、Phaser の DOM Elements サポートを確認します。貢献内容をフレームワークレベルのアクセシビリティ基盤とするのか、公式のガイダンスおよび例とするのかを定義します。メニュー、シーン変更、アナウンス、フォーカス管理を対象とするスコープについて合意できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hi Phaser team. This is both a feature request and a general request for guidance. I had a quick look through your open issues for dupes, but couldn't find one.
Most Phaser game content is rendered to canvas/WebGL by default. Screen reader users are therefore unable to directly access menu and game-state content when it is implemented with Phaser Text objects, sprites, menu selections, and scene changes, because that content is rendered inside the canvas/WebGL output and is not represented in the browser accessibility tree.
Example of current markup, which behaves like a black-box for screenreaders:
<div id="game-container">
<canvas width="1280" height="720"> Example Phaser game. </canvas>
</div>
I recognize this is fundamentally a browser/canvas limitation, and that Phaser cannot infer useful screen reader semantics from user-side assets like sprites.
I also saw that Phaser already supports DOM Elements through dom.createContainer, and that could be relevant to a final implementation strategy. The gap I'm running into is that I couldn't find official guidance or examples for using that feature to expose screen reader semantics for the canvas-rendered game UI.
To improve screen reader experience you'd need to manually construct a parallel DOM layer alongside the Phaser game canvas. This would include:
- visually-hidden DOM that mirrors Phaser menus
- ARIA live regions for scene changes and gameplay events
- imperative and manual focus management
- callbacks from every menu, dialog, HUD, and state change so the hidden DOM stays in sync.
While that could be done, it is a lot of duplicated infra and really brittle as it could lead to state-drift.
Would Phaser be open to providing framework-level features for better accessibility semantics?
Here's an example of an API that could be worth exploring:
this.accessibility.setSceneDescription("Main menu");
startText.setAccessible({
role: "button",
label: "Start Game",
focusable: true,
selected: true,
onActivate: () => this.startGame(),
});
this.accessibility.announce("Wave 1 starting", { priority: "polite" });
The game authors would still provide the labels, roles, states, and announcement text.
Phaser could then provide the associated DOM/live-region/focus plumbing. This would mean that downstream users don't need to manage the hidden DOM mirror manually.
Some guides on your website or in the repo would be equally helpful, particularly if there's an alternative approach that you recommend.
Optional: Do you want to help provide this feature?
Happy to open a PR if that's helpful, though I'd like to validate my assumptions first.
Thanks in advance. Big fan of the framework, keep up the great work! 💖
- 主要言語
- JavaScript
- スター
- 40.7k
- フォーク
- 7.2k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
phaserjs/phaser のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 3 日以内に返信
-
Type definition for TilemapLayer.getTileAt is wrong対応中かも @hkbughk が 34 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 3 日以内に返信
-
Shader.preDestroy leaks its ShaderQuad's vertex buffer and VAO on every create/destroy cycle (4.2.1)対応中かも @k1epg01ng129-eng が 32 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 3 日以内に返信
-
Black opaque background on transparent Phaser.Text textures in Phaser 4.2.1 on older iOS WebGL対応中かも @SamuelMalmfors が 14 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
phaserjs/phaser#7392 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
phaserjs/phaser の issue をすべて見る
似ている issue
-
enhancement ready
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
DCGM/semant-demo#708 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
agents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Client codegen: an import repeated in an impl file is emitted twice, and the browser rejects the module対応中かも @MalithaPrabhashana が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
jaseci-labs/jac#10756 ·
メンテナーはふだん 1 日以内に返信