Properties:
Name | Type | Description |
---|---|---|
Keys |
object | Stores all keys that can be pressed, along with methods to tell if they are being pressed. |
The main namespace, contains all of Pixel's functions.
Example
// Create a new Pixel Stage
var app = new Pixel.Stage({width: 400, height: 400});
// Add stage to document page
document.body.appendChild(app.view);
// Check for key presses
app.on("keydown", function (e) {
if (e.key === Pixel.Keys.SHIFT) {} // If shift is pressed, this triggers
});
// Second method for checking for key presses
app.tick = function () {
if (Pixel.Keys.down.SHIFT) {} // If shift is pressed, this triggers too. More fluid/quicker
}
Classes
- AnimatedSprite
- Circle
- Container
- Graphics
- Map
- Physics
- Point
- Rectangle
- Sound
- Sprite
- SpriteSheet
- Stage
- Text
- Texture