# dsplay

> Small utility toolset for canvas 2D.

Latest version **0.0.2** (published 2016-01-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install dsplay
pnpm add dsplay
yarn add dsplay
bun add dsplay
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2016-01-31 |
| First published | 2016-01-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | mdtarso |
| Maintainers | mdtarso |

## Links

- npm: https://www.npmjs.com/package/dsplay
- Repository: https://github.com/gamestdio/dsplay
- Homepage: https://github.com/gamestdio/dsplay#readme
- Issues: https://github.com/gamestdio/dsplay/issues
- npm.io page: https://npm.io/package/dsplay

## Recent versions

- 0.0.2 (latest) — 2016-01-31
- 0.0.1 — 2016-01-26

## README

# DSPLAY

A simple display list for canvas 2D.

### HTML Setup
- Download:
- Include: `<script src="dsplay.min.js" charset="utf-8"></script>`

### Node/Browserify Setup
- Install: `npm install dsplay`
- Include: `var dsplay = require('dsplay');`

### Usage
```javascript
// Everything starts with a Renderer and a Sprite:
var renderer = new dsplay.Renderer(canvas);
var container = new dsplay.Sprite();

// Sprites are just transform entities, so you need to draw stuff by yourself:
var box = new dsplay.Sprite();
container.add(box);
box.draw = (ctx) => {
  ctx.fillStyle = '#FF0000';
  ctx.fillRect(0, 0, 64, 64);
}

// Render loop:
render();
function render() {
  renderer.render(container);
  requestAnimationFrame(render);
}

// Also, there are some useful sprite-based objects, like Img:
var img = new dsplay.Img();
container.add(img);
img.y = 80;
img.load('https://goo.gl/QHEIDK');

// And Label:
var label = new dsplay.Label();
container.add(label);
label.x = 80;
label.color = '#FFFFFF';
label.text = 'Hello world!';
```

---
_Source: https://npm.io/package/dsplay · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
