# @intesso/scratch-render

> WebGL Renderer for Scratch 3.0

Latest version **0.1.2** (published 2019-12-19) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @intesso/scratch-render
pnpm add @intesso/scratch-render
yarn add @intesso/scratch-render
bun add @intesso/scratch-render
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2019-12-19 |
| First published | 2019-07-12 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 18.3 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 270 |
| Author | Massachusetts Institute of Technology |
| Maintainers | intesso |

## Links

- npm: https://www.npmjs.com/package/@intesso/scratch-render
- Repository: https://github.com/LLK/scratch-render
- Homepage: https://github.com/LLK/scratch-render#readme
- Issues: https://github.com/LLK/scratch-render/issues
- npm.io page: https://npm.io/package/@intesso/scratch-render

## Dependencies (10)

- [hull.js](https://npm.io/package/hull.js.md) 0.2.10
- [minilog](https://npm.io/package/minilog.md) 3.1.0
- [twgl.js](https://npm.io/package/twgl.js.md) 4.4.0
- [linebreak](https://npm.io/package/linebreak.md) 0.3.0
- [ify-loader](https://npm.io/package/ify-loader.md) 1.0.4
- [raw-loader](https://npm.io/package/raw-loader.md) ^0.5.1
- [scratch-storage](https://npm.io/package/scratch-storage.md) ^1.0.0
- [grapheme-breaker](https://npm.io/package/grapheme-breaker.md) 0.3.2
- [@intesso/scratch-env](https://npm.io/package/@intesso/scratch-env.md) ^1.0.0
- [@intesso/scratch-svg-renderer](https://npm.io/package/@intesso/scratch-svg-renderer.md) ^0.2.3

## Recent versions

- 0.1.2 (latest) — 2019-12-19
- 0.1.1 — 2019-07-12
- 0.1.0 — 2019-07-12

## README

## scratch-render
#### WebGL-based rendering engine for Scratch 3.0

[![Build Status](https://travis-ci.org/LLK/scratch-render.svg?branch=develop)](https://travis-ci.org/LLK/scratch-render)
[![Greenkeeper badge](https://badges.greenkeeper.io/LLK/scratch-render.svg)](https://greenkeeper.io/)

## Installation
```bash
npm install https://github.com/LLK/scratch-render.git
```

## Setup
```html
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Scratch WebGL rendering demo</title>
    </head>

    <body>
        <canvas id="myStage"></canvas>
        <canvas id="myDebug"></canvas>
    </body>
</html>
```

```js
var canvas = document.getElementById('myStage');
var debug = document.getElementById('myDebug');

// Instantiate the renderer
var renderer = new require('scratch-render')(canvas);

// Connect to debug canvas
renderer.setDebugCanvas(debug);

// Start drawing
function drawStep() {
    renderer.draw();
    requestAnimationFrame(drawStep);
}
drawStep();

// Connect to worker (see "playground" example)
var worker = new Worker('worker.js');
renderer.connectWorker(worker);
```

## Standalone Build
```bash
npm run build
```

```html
<script src="/path/to/render.js"></script>
<script>
    var renderer = new window.RenderWebGLLocal();
    // do things
</script>
```

## Testing
```bash
npm test
```

## Donate
We provide [Scratch](https://scratch.mit.edu) free of charge, and want to keep it that way! Please consider making a [donation](https://secure.donationpay.org/scratchfoundation/) to support our continued engineering, design, community, and resource development efforts. Donations of any size are appreciated. Thank you!

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