anypixel
v1.0.2
Published
A web-friendly way to build unusual displays
Downloads
4
Readme
Anypixel
A web-friendly way to build unusual displays.
Welcome to the "beta" version of the Anypixel framework. The Anypixel framework is designed to make it easy to develop content for unusual physical interactive displays.
Anypixel provides a canvas, a few button events, and some information about the display. The rest is up to you!
Getting Started
- Install the previewer tool:
npm install -g https://anypixel-storage.appspot.com/npm/anypixel-previewer.tar.gz
See the Anypixel-Emulator repository for more information about using the previewer tool.
- Check out the getting-started example app
For more info:
Usage
var anypixel = require('anypixel');
Canvas
The canvas
object is a thin wrapper around the drawing canvas:
anypixel.canvas.getContext2D(); // Returns the '2d' context
anypixel.canvas.getContext3D(); // Returns the 'webgl' context
Config
The config
object contains the following display properties:
anypixel.config.width; // Width of the canvas, in pixels
anypixel.config.height; // Height of the canvas, in pixels
anypixel.config.canvasId; // The DOM ID of the canvas element
Events
onButtonDown: dispatched when a button is pressed
document.addEventListener('onButtonDown', function(event) {
// event.detail.x: x-axis coordinate
// event.detail.y: y-axis coordinate
});