Pass ForgeDocs Product page

Component

Accessibility Menu

A ready options menu, or the glue for your own, that lets players turn down flashes and shakes, adjust colors for color blindness, enlarge HUD numbers and tone down blood, saved between sessions.

Add Component > Pass Forge > Accessibility Menu GameObject > Pass Forge > Accessibility Menu API reference

What it does

The Accessibility Menu connects an options menu's controls to Pass Forge's accessibility settings: a safe mode toggle for players sensitive to flashing and motion, sliders for flashes, screen shake, color adjustment and text size, a color blindness dropdown, and a blood dropdown. Each change applies at once and is saved, and the saved choices come back by themselves the next time the game starts, before the first scene shows.

GameObject > Pass Forge > Accessibility Menu builds a ready menu on a frosted PF Panel, wired up, with a Close button. It adds the Blood dropdown only when your game uses Lens Blood, so a puzzle or family game keeps a menu without it.

In a menu of your own, add the component and drag your controls into its fields. Every field is optional, so a small menu with only a safe mode toggle works too.

These settings act on every camera that shows Pass Forge's screen effects, and on Pass Forge's HUD. Safe mode, for example, dims lightning and flashbangs, shortens screen shake, holds Off-screen Indicators, Compass Bar markers, Route arrows and Beacons steady, and calms damage numbers.

Add it

  1. Choose GameObject > Pass Forge > Accessibility Menu.
  2. The menu goes in the middle of the selected UI object's canvas, or of a new Screen Space - Overlay canvas, with an Event System when the scene has none. It holds a title, the safe mode toggle, the Flashes and Screen shake sliders, the Blood dropdown when the game uses blood, the Colors for dropdown, the Color adjustment and Text size sliders, and a Close button.
  3. Run Tools > Pass Forge > Set Up Effects once per project and turn Post Processing on for the camera, so the frosted glass behind the menu shows.
  4. Switch the menu's object off in the scene, and switch it on from your own Options button. Close switches it off again.
  5. Press Play, open the menu and tick safe mode. A screen shake now moves a quarter as far.
Inspector
Accessibility Menu Inspector

To wire a menu you built yourself, add Add Component > Pass Forge > Accessibility Menu to it and drag your controls into its fields.

Settings

The component has no custom Inspector: each field takes a Unity UI control.

SettingWhat it does
Safe ModeA Toggle that switches safe mode: softer flashes and shakes for players sensitive to them.
FlashesA Slider for how strong flashes are, from none to as designed. Its range is set to 0 to 1.
ShakeA Slider for how far the screen shakes, from not at all to as designed. Its range is set to 0 to 1.
Color BlindnessA Dropdown for the color blindness colors are adjusted for: None, Protanopia, Deuteranopia, Tritanopia, in this order.
Color AdjustmentA Slider for how strongly colors are adjusted for the color blindness. Its range is set to 0 to 1.
Text SizeA Slider for how big on-screen numbers are, from as designed to twice the size: damage numbers, the distances beside Off-screen Indicators, the numbers and distances on Compass Bars, and Fog of War Radar ring labels. Its range is set to 1 to 2.
BloodA Dropdown for how blood shows: Shown, Not red and Off, in this order.

When the menu is switched on, each control shows the current setting without counting as a change. The component sets each slider's minimum and maximum itself.

Saving: a toggle or dropdown change saves at once. A slider saves half a second after it stops moving, so a drag saves once. A change still waiting is saved when the menu is switched off, when the game pauses, loses focus or quits.

Project Settings > Pass Forge > Accessibility

This page shows the player choices saved on your machine, which come back each time Play Mode starts, with a Forget Saved Choices button. In Play Mode it lets you try Safe Mode, Colors For and Text Size without a menu and without saving them.

Common jobs

Add an accessibility menu to a game with blood

  1. Make sure the open scenes, or the prefabs they hold, use Lens Blood: a Lens Blood component, a Moment with a Lens Blood step, or a Volume that restyles Lens Blood. A script under Assets that calls PassForgeLensBlood.Splat, SplatFrom, SplatOnEdge or SplatAt counts too.
  2. Choose GameObject > Pass Forge > Accessibility Menu.

The menu gets a Blood row after Screen shake, with Shown, Not red and Off. Not red shows red splats in the Lens Blood component's Toned Down Color; Off shows no blood on the lens and wipes what is there.

Wire your own options menu

  1. Build your menu with Unity UI controls: a Toggle, Sliders and Dropdowns.
  2. Add Add Component > Pass Forge > Accessibility Menu to the menu's root.
  3. Drag each control into its field. Leave out the ones your game does not need.
  4. Give the Color Blindness dropdown four options in this order: None, Protanopia, Deuteranopia, Tritanopia. Give the Blood dropdown Shown, Not red, Off.

Call the setters from your own events

The component's public methods can be picked in any UnityEvent: SetSafeMode (bool), SetFlashStrength, SetShakeStrength, SetColorAdjustment, SetTextScale (float), SetColorBlindness and SetBlood (int, in the dropdown order). Each one applies the setting and saves it.

Start fresh while testing

Choices you make while testing your menu are saved on your machine and come back each time Play Mode starts. Open Edit > Project Settings > Pass Forge > Accessibility and press Forget Saved Choices.

Offer a North Up minimap

A turning minimap or radar is harder for some players to follow. Add a toggle of your own that sets minimap.orientation = MinimapOrientation.NorthUp;.

From a script

using PassForge.Effects;
using UnityEngine;

// An options menu of your own, without the component. Hook each method to a Toggle, Slider or Dropdown.
public class AccessibilityOptions : MonoBehaviour
{
    public void SetSafeMode(bool on) => PassForgeAccessibility.safeMode = on;
    public void SetShake(float strength) => PassForgeAccessibility.shakeStrength = strength;   // 0 to 1
    public void SetFlash(float strength) => PassForgeAccessibility.flashStrength = strength;   // 0 to 1
    public void SetTextScale(float scale) => PassForgeAccessibility.textScale = scale;         // 1 to 2
    public void SetColorAdjustment(float amount) => PassForgeAccessibility.colorAdjustment = amount;

    // Dropdown order: None, Protanopia, Deuteranopia, Tritanopia.
    public void SetColorBlindness(int index) => PassForgeAccessibility.colorBlindness = (ColorBlindness)index;

    // Dropdown order: Shown, Not Red, Off. Off also clears the blood on the lens at once.
    public void SetBlood(int index) => PassForgeAccessibility.blood = (BloodSetting)index;

    // Saved with PlayerPrefs; the choices come back by themselves the next time the game starts.
    void OnDisable() => PassForgeAccessibility.Save();

    // A Cancel button: back to the choices last saved. False when none were saved.
    public void Cancel() => PassForgeAccessibility.Load();

    // A Reset button: forget the saved choices and go back to how the game ships.
    public void ResetAll() => PassForgeAccessibility.ClearSaved();
}

Good to know

  • Unity UI controls. The fields take Unity UI's Toggle, Slider and Dropdown. TextMeshPro dropdowns do not fit the Color Blindness and Blood fields; call the component's setters from them instead.
  • One per object. An object holds one Accessibility Menu.
  • Saved with PlayerPrefs. PassForgeAccessibility.Save() keeps every setting under one PlayerPrefs key, and the saved choices load before the first scene. A game with a save system of its own can set the values from it instead and skip the component.
  • Achromatopsia is only for the Color Vision effect's Simulate check. The menu offers the four adjustable kinds.
  • Game values stay fair. PassForgeScreenFlash.blindness, the game's own value for how blind the player is, is not lowered by safe mode or the flash slider, so turning flashes down gives no advantage.
  • Overlay canvases. Compass Bars, minimaps and Fog of War Radars on a Screen Space - Overlay canvas adjust their markers, blips, pings and the route for the color blindness setting themselves, since they draw after the screen effects.
  • Screen effect needs. The settings act through Pass Forge's screen effects, so the effects must be set up and the camera must have Post Processing on. They need no Volume.
  • Damage numbers can be turned off as an option of your own with PassForgeDamageNumbers.visible = false; Pass Forge does not save that one.
  • Unity UI only. The component needs the Unity UI package (com.unity.ugui).