# tiny-canvas

> Tiny canvas rendering library.

Latest version **0.0.17** (published 2020-04-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install tiny-canvas
pnpm add tiny-canvas
yarn add tiny-canvas
bun add tiny-canvas
```

## 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.17 |
| Published | 2020-04-16 |
| First published | 2020-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 154.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | hota1024 |
| Maintainers | hota1024 |

## Links

- npm: https://www.npmjs.com/package/tiny-canvas
- npm.io page: https://npm.io/package/tiny-canvas

## Recent versions

- 0.0.17 (latest) — 2020-04-16
- 0.0.16 — 2020-04-12
- 0.0.15 — 2020-03-20
- 0.0.14 — 2020-03-16
- 0.0.13 — 2020-03-15
- 0.0.12 — 2020-03-15
- 0.0.11 — 2020-03-15
- 0.0.10 — 2020-03-15
- 0.0.9 — 2020-03-15
- 0.0.8 — 2020-03-15
- 0.0.7 — 2020-03-15
- 0.0.6 — 2020-03-15
- 0.0.5 — 2020-03-15
- 0.0.4 — 2020-03-15
- 0.0.3 — 2020-03-09
- … 3 more at https://npm.io/package/tiny-canvas/versions

## README

# tiny-canavs

tiny-canvas is a simple HTML canvas library for TypeScript/JavaScript.

## Installation

```bash
yarn add tiny-canvas
# or
npm install tiny-canvas
```

## Usage

Simple usage(Draw circle at cursor position).

```typescript
import {
  TinyGame,
  CanvasRenderer,
  AnimationFrameRequestTicker,
  CanvasInputManager
} from 'tiny-canvas'

// Game class that extends TinyGame class
export class Game extends TinyGame {
  constructor(canvas: HTMLCanvasElement) {
    // TinyGame constructor (Renderer, InputManager, Ticker)
    super(
      new CanvasRenderer(canvas),
      new CanvasInputManager(canvas),
      new AnimationFrameRequestTicker()
    )
  }

  /**
   * Call on frame.
   */
  onFrame() {
    // Fill background.
    this.fillRect(this.leftTop, this.rightBottom, 'black')

    // Draw circle at cursor position.
    this.fillCircle(this.cursor, 32, 'white')
  }
}

```

## Build

Build `yarn build`
Watch build `yarn dev`

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