-
Notifications
You must be signed in to change notification settings - Fork 0
Visual Accessibility
Visual accessibility features are related to how players can identify and understand visual content in your game.
People need to be able to understand and identify your content in order to interact with it. For example, if red text signifies something and green text signifies the opposite, how would someone with color-blindness identify the difference in content? If there is an important chunk of text that you need to read quickly, how would someone with dyslexia be able to understand that content? If there is a small icon at the bottom of the screen that identifies an enemy is approaching turns on, how would someone who cannot see small detail identify that change?
By following the instructions in this github repository, you can implement some unity features that improve the visual accessibility of your game. However, this is not all you will need to do. Some features are game-specific, like important animations, dialogue voice-overs, and UI layouts. To learn about more visual accessibility features, we recommend the following resources:
Something important to remember is that blindness and low vision include a variety of conditions and abilities. Out of all documented people with "eye disorders", only 15% are totally blind and have no residual vision. Your game does not have to be audio-only to be accessible to some people with low vision and blindness. That being said, the more work you put in, the more people can play and enjoy your game.
For basic instructions and definitions, click here.
Font is the style of your text. There is no right or wrong font to choose for your game. However, only having single font is not accessible. Reading very stylized fonts can be very difficult for players, especially players with disabilities.
We recommend having at least three options: the original font, a simple sans-serif font, and a dyslexia-friendly font. The more diverse options you add the more accessible it is. For example, adding a font specifically for people with low vision or a serif font. There are a number of fonts designed specifically for people with low-vision, including Atkinson Hyperlegible. For dyslexia-friendly fonts, we recommend Open Dyslexic.
Having changeable font is important to a variety of disabilities, including low vision, blindness, dyslexia, and other reading-based disabilities. If your font is hyper-stylized, it can even be difficult for people without disabilities to read it.
No matter your game's type, you will have to spend a lot of time on your game's written content. If a player cannot read that content, then they cannot appreciate the time and effort you put in. Changing font is a limited amount of work, for a big reward.
Before trying this, you should have a basic understanding of the Unity Editor, C#, and UI game objects.
Steps:
- Decide what your original, sans-serif, and dyselxia friendly fonts will be
- You are not limited to three different fonts
- Import those fonts into your project and, optionally, make TextMeshPro versions of the .otf files
- If you only use Text components, you do not need to make a TextMeshPro font asset. Otherwise, you need a TextMeshPro font asset for each of the different fonts
- Import the changingfontpackage.unitypackage or download the FontManager.cs script into your own project
- The FontManager.cs script manages font changes for all of the gameObjects in the current scenes
- The FontManager.cs script should always exist to change fonts as scenes change
- All canvases must be able to call the Register function when they spawn. You can use Singleton functionality to do this
- When a scene is loaded or unloaded, the SceneChange function must be called
- Make an empty gameObject and attach the FontManager.cs script. Give it the fonts you chose in the proper order
- Your original font should be the top font of FontsPro and Fonts in the editor. All other fonts can be in any order, but must stay consistent
- The order of fonts in the FontsPro and Fonts serialized variables must stay consistent between them. For example, FontsPro would be original, sans-serif, dyslexia friendly and Fonts would be original, sans-serif, dyslexia friendly
- Use the Dropdown prefab as an example for how to set up the dropdown that changes font options
- You will need a dropdown that contains font names or categories in the same order as FontsPro and Fonts in the FontManager.cs editor
- Do not have the scipt FontManager.cs attached to your dropdown, unless you have skipped step 3
- When OnValueChanged is called for the dropdown, it should call the ChangeFont function of FontManager.cs
- The value of the dropdown will correspond to the index of FontsPro and Fonts
- Call the SceneChange function of FontManager.cs every time the scene changes
- Every time a scene is loaded or unloaded, the text that exists changes, and therefore the fonts must be changed
- The font will change even for text objects that are inactive
- Call the Register function of FontManager.cs every time a canvas or text (including TextMeshPro) gameObject is spawned in the scene, and pass in the canvas or text gameObject
- If you spawn in a gameObject that contains or is a text gameObject object (ex. canvas, button, TextMeshPro element), it must call Register
- Spawning a gameObject means calling the Spawn function, not just setting a gameObject to active. All gameObjects originally in the scenes loaded, active or inactive, have their font changed
Is something in the wiki wrong or out of date? Is there something you'd like us to add? Let us know at [email protected]!
Code-based Accessibility Features
Have any questions? Contact us at [email protected] or start a GitHub discussion! This is a living project, so we are constantly improving and growing.