Giter Site home page Giter Site logo

scottmcdonnell / pixi-accessibility Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 211 KB

Allow pixi items to be accessed using tab and read by screen readers. Now working for IOS Voiceover & Android Talkback.

License: MIT License

HTML 20.95% JavaScript 79.05%

pixi-accessibility's Introduction

#update

Now tested in:

  • IOS VoiceOver for IOS 9
  • Android TalkBack
  • Kindle VoiceView for FireHD 6

Check it out in action here on desktop with tabbing and mobile with screenreader enabled:

DEMO

pixi-accessibility

A plugin that adds accessibility to Pixi.js

Note: This modules requires v3.0.9 (or higher) of pixi.js.

image

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

Much like interaction any DisplayObject can be made accessible. This manager will map the events as if the mouse was being used, minimizing the efferot required to implement.

Usage

I have made this as easy as possible to use in the hope that all those awesome pixi sites and games can become usable by people without the ability to use the mouse or see content.

// Create a sprite as usual..
var mySprite = PIXI.Sprite.fromImage('myImage.png');

// Make sprite interactive..
mySprite.interactive = true;

// Make it accessible..
mySprite.accessible = true;
// The description of the button for the screen reader
mySprite.accessibleTitle = 'Hello Button';

mySprite.click = function(){

  alert("Hello")

}

function animate() {
    requestAnimationFrame(animate);
    renderer.render(stage);
}

animate();

Building

You normally don't need to build this module, you can just download a release from the releases page.

However, if you are developing on the project or want a bleeding edge build then you will need to have node and gulp setup on your machine.

Then you can install dependencies and build:

npm i && npm run build

That will output the built distributables to ./bin.

Your support helps us make Pixi.js even better. Make your pledge on Patreon and we'll love you forever!

pixi-accessibility's People

Contributors

goodboydigital avatar

Stargazers

 avatar

Watchers

Scott McDonnell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.