GithubHelp home page GithubHelp logo

doc22940 / scratch-render Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scratchfoundation/scratch-render

1.0 1.0 0.0 4.36 MB

WebGL-based rendering engine for Scratch 3.0

License: BSD 3-Clause "New" or "Revised" License

HTML 4.48% JavaScript 92.38% GLSL 3.09% CSS 0.05%

scratch-render's Introduction

scratch-render

WebGL-based rendering engine for Scratch 3.0

Build Status Greenkeeper badge

Installation

npm install https://github.com/LLK/scratch-render.git

Setup

<!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>
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

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

Testing

npm test

Donate

We provide Scratch free of charge, and want to keep it that way! Please consider making a donation to support our continued engineering, design, community, and resource development efforts. Donations of any size are appreciated. Thank you!

scratch-render's People

Contributors

a49594a avatar adroitwhiz avatar benjiwheeler avatar cwillisf avatar evhan55 avatar fsih avatar gnarf avatar greenkeeper[bot] avatar griffpatch avatar joshlory avatar kchadha avatar ktbee avatar mraerino avatar mzgoddard avatar paulkaplan avatar peabrainiac avatar picklesrus avatar rschamp avatar sillyinventor avatar thebrokenrail avatar thisandagain avatar tmickel avatar towerofnix avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.