npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

springroll

v2.7.0

Published

![logo](http://springroll.io/assets/images/logo.png)

Downloads

3,422

Readme

logo

SpringRoll

SpringRoll is a light-weight toolset for building accessible HTML5 games. The latest version, SpringRoll 2, is a large departure from its predecessor. SpringRoll 2 is less prescriptive and contains only a few guidelines and restrictions. Instead, the framework focuses on utilities to help developers make games more accessible and deployable at scale.

Quick Navigation

If you need more info on the various components of SpringRoll see the individual docs below or view the module overview

  • Application - The main SpringRoll Application class
  • Plugin architecture - implementing and/or using custom plugins to augment SpringRoll behaviour
  • Accessibility Module - SpringRoll contains submodules for various accessibility testing and enhancement.
  • Controller module - provides a mechanism for mapping keyboard input to functions
  • Debugger module - provides a centralized set of methods for logging that can be enabled or disabled at runtime.
  • Localization Modules
    • Localizer - provides support for multiple languages
    • Captions - Caption players and renderers
  • Scale Manager - helps developers to react to screen size changes
  • State Manager - provides classes for creating subscribable properties that notify listeners when they are changed

Design Considerations

The SpringRoll ecosystem provides a combination of mechanisms for deploying games via the web:

SpringRoll games, also referred to as Applications, are typically hosted in an iframe and controlled via a SpringRoll Container instance. This extra layer is mainly used to separate the game's internals from the environment in which it lives. This allows the game to live in multiple environments without any complicated environment specific code. The application can request relevant information from the container without having to know where that information came from.

Seed Project

We provide a very basic starter project that comes with Webpack for quick project ramp up.

We've also provided a few template projects.

Installation

SpringRoll is both ES6 module and UMD compatible, and is available via NPM. NPM can install it directly from the command line:

npm install --save springroll@2

However, to request a specific commit or branch, update package.json directly:

{
  ...
  "dependencies" : {
    "springroll": "git+https://github.com/SpringRoll/SpringRoll.git#v2"
  }
  ...
}

Once the module is installed, SpringRoll can be imported in ES6 directly:

import * as springroll from 'springroll';

const app = new springroll.Application();

or with CommonJS:

const springroll = require('springroll');

const app = new springroll.Application();

or even as a browser global:

<script src="node_modules/springroll/dist/SpringRoll.js"></script>
<script>
const app = new window.springroll.Application();
</script>

Module Overview

SpringRoll consists of a handful of modules intended to help developers improve the accessibility of their game.

Application Module

The Application class provides the main communication bus through which the game can send and receive messages to the container. It also manages global game state, such as pause and captions display. More information can be found in the Application module documentation. It also consists of a simple plugin architecture for hooking into the load sequence of applications.

Accessibility Module

SpringRoll contains submodules for various accessibility testing and enhancement. The Color Filter module provides filters for testing color blindness support in your game. Enabling the class allows developers to see what their game would look like for various types of color vision deficiency. The Speech Synth module gives developers the ability to synthesize speech from text.

Controller Module

The Controller module provides a mechanism for mapping keyboard input to functions which can help centralize user input management and make supporting multiple input mechanisms easier.

Debugger Module

The Debugger module provides a centralized set of methods for logging that can be enabled or disabled at runtime.

Localization Module

The Localization module provides support for supporting multiple languages in games and captions

Scale Manager Module

The Scale Manager module helps developers to react to screen size changes.

State Manager Module

The State Manager module provides classes for creating subscribable properties that notify listeners when they are changed. This is used for managing pause, captions, and audio mute state in the Application class, but can also be used for other generic uses.

Differences between v1 and v2 branches

V1 (Legacy)

V1 is the original version of SpringRoll and was built to address many issues/missing functionality that are now native to JavaScript since ES2016. It comes with its own versions of popular libraries like Pixi.js and Easel.js, but it's not recommended to use this version as it will only receive legacy support.

V2 (Recommended)

V2 is massive overhaul of SpringRoll, removing all third party libraries and is rewritten to utilize ES2016. This version will be actively receiving bug fixes, new features and is the recommended version of SpringRoll.

BrowserStack Testing

To test Springroll v2 on BrowserStack. Copy .env.sample and rename it to .env. Replace the placeholder values with your own BrowserStack credentials, and then run npm run test:bs.