Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AccessibilityManager

The Accessibility manager recreates the ability to tab and have content read by screen readers. This is very important as it can possibly help people with disabilities access PixiJS content.

A DisplayObject can be made accessible just like it can be made interactive. This manager will map the events as if the mouse was being used, minimizing the effort required to implement.

An instance of this class is automatically created by default, and can be found at renderer.plugins.accessibility

memberof

PIXI

Hierarchy

  • AccessibilityManager

Index

Constructors

constructor

  • Parameters

    • renderer: CanvasRenderer | Renderer

      A reference to the current renderer

    Returns AccessibilityManager

Properties

Private _hookDiv

_hookDiv: any

Button element for handling touch hooks.

Private _isActive

_isActive: any

Internal variable, see isActive getter.

Private _isMobileAccessibility

_isMobileAccessibility: any

Internal variable, see isMobileAccessibility getter.

Private _onClick

_onClick: any

Maps the div button press to pixi's InteractionManager (click)

param

The click event.

Private _onFocus

_onFocus: any

Maps the div focus events to pixi's InteractionManager (mouseover)

param

The focus event.

Private _onFocusOut

_onFocusOut: any

Maps the div focus events to pixi's InteractionManager (mouseout)

param

The focusout event.

Private _onKeyDown

_onKeyDown: any

Is called when a key is pressed

param

The keydown event.

Private _onMouseMove

_onMouseMove: any

Is called when the mouse moves across the renderer element

param

The mouse event.

Private activate

activate: any

Activating will cause the Accessibility layer to be shown. This is called when a user presses the tab key.

Private addChild

addChild: any

Adds a DisplayObject to the accessibility manager

param

The child to make accessible.

Private androidUpdateCount

androidUpdateCount: any

Count to throttle div updates on android devices.

Private androidUpdateFrequency

androidUpdateFrequency: any

The frequency to update the div elements.

Private children

children: any

The array of currently active accessible items.

Private createTouchHook

createTouchHook: any

Creates the touch hooks.

Private deactivate

deactivate: any

Deactivating will cause the Accessibility layer to be hidden. This is called when a user moves the mouse.

debug

debug: boolean

Setting this to true will visually show the divs.

Private destroyTouchHook

destroyTouchHook: any

Destroys the touch hooks.

Private div

div: any

This is the dom element that will sit over the PixiJS element. This is where the div overlays will go.

Private pool

pool: any

A simple pool for storing divs.

Private renderId

renderId: any

This is a tick used to check if an object is no longer being rendered.

renderer

renderer: CanvasRenderer | Renderer

The renderer this accessibility manager works for.

Private update

update: any

Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects.

Private updateAccessibleObjects

updateAccessibleObjects: any

This recursive function will run through the scene graph and add any new accessible objects to the DOM layer.

param

The DisplayObject to check.

Accessors

isActive

  • get isActive(): boolean
  • Value of true if accessibility is currently active and accessibility layers are showing.

    member

    {boolean}

    readonly

    Returns boolean

isMobileAccessibility

  • get isMobileAccessibility(): boolean
  • Value of true if accessibility is enabled for touch devices.

    member

    {boolean}

    readonly

    Returns boolean

Methods

capHitArea

  • Adjust the hit area based on the bounds of a display object

    Parameters

    Returns void

destroy

  • destroy(): void
  • Destroys the accessibility manager

    Returns void

updateDebugHTML

  • private function that will visually add the information to the accessability div

    Parameters

    Returns void

Generated using TypeDoc