This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e2d = require('e2d'); | |
var r = e2d.Renderer.create(800, 600); | |
r.ready(); | |
var i = 0; | |
r.on('frame', function() { | |
i ++; | |
return r.render( | |
e2d.clearRect(800, 600), | |
e2d.translate(400, 300, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e2d = require('e2d'); | |
var p2 = require('p2'); | |
var r = e2d.Renderer.create(800, 600); | |
var cvs = e2d.Canvas.create(800, 600); | |
r.ready(); | |
r.on('frame', function() { | |
if (!r.mouseData.clicked && r.mouseData.state === 'down') { | |
cvs.render( | |
e2d.moveTo(r.previousMouseData.x, r.previousMouseData.y), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Script "Entry Point" | |
= code:(TemplateString / DoubleQuotedString / SingleQuotedString / Numeric | |
/ Keyword / Identifier / Comment / .)* { | |
return code.join('') | |
} | |
Comment "Comment" | |
= comment:("//" [^\n]*) { | |
return '<span class="comment">' + [].concat.apply([], comment).join('') +'</span>' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e2d = require('e2d'); | |
var r = e2d.Renderer.create(400, 400); | |
r.ready(); | |
var anchor = {x:0,y:0}, lastMousePosition = {x:0, y:0}, dragging = false; | |
r.on('frame', function() { | |
var hovering = r.mouseData.activeRegions.indexOf('rect') !== -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Part } from 'sidekick-worker'; | |
import { Animation } from 'sidekick-worker-animation'; | |
import { quadInOut } from 'ease-functions'; | |
module.exports = class ExamplePart extends Part { | |
constructor() { | |
super(); | |
//setting this.animation = [] opts into the animation engine | |
this.animation = []; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e2d = require('e2d'); | |
var r = e2d.Renderer.create(400, 400); | |
var helloWorld = e2d.fillText('Hello World'); | |
r.ready(); | |
r.on('frame', | |
() => r.render( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e2d = require('e2d'); | |
var r = e2d.Renderer.create(400, 400); //create the renderer | |
r.ready(); | |
var helloWorld = e2d.fillText('Hello World'); //hello world text | |
r.on('frame', function() { //60 frames per second | |
return r.render( | |
e2d.clearRect(400, 400), //clear the screen | |
e2d.translate(200, 200, //move to the center |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e2d = require('e2d'); | |
var r = e2d.Renderer.create(400, 400); | |
r.ready(); | |
r.on('frame', function() { | |
return r.render( | |
e2d.clearRect(400, 400), | |
e2d.translate(200, 200, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e2d = require('e2d'); | |
var r = new e2d.Renderer(400, 400); | |
var img = new e2d.Img(); | |
img.src="http://www.petethecatbooks.com/wp-content/themes/petethecat/public/img/header/header-cat.png"; | |
img.on('load', function() { | |
r.ready(); | |
}) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
React.render( | |
React.DOM.b({}, "Hello World!"), | |
document.body | |
); |