Skip to content

CreateJS/EaselJS-NodeJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

6 Commits

Repository files navigation

node-easel

node-easel is a node wrapper for EaselJS. For use with NodeJS, built on-top of node-canvas

Installation

$ npm install node-easel 

Note Cairo graphics is required to run node-easel && node-canvas. Read the install docs at https://github.com/LearnBoost/node-canvas, for full install instructions.

Examples

To see a full working demo, checkout the examples folder.

Simple Example

node-easel is completely polymorphic with EaselJS. A good starting point is to checkout the EaselJS documentation.

//Import easelrequire('node-easel');varStage=createjs.Stage;varShape=createjs.Shape;varGraphics=createjs.Graphics;varfs=require('fs');//Create the canvas to draw tovarc=newCanvas(980,580);varctx=c.getContext('2d');//Create graphics objectvarg=newcreatejs.Graphics();varshape=newcreatejs.Shape(g);//Draw a circleg.setStrokeStyle(8).beginStroke("#F0F").beginRadialGradientFill(["#FF0","#00F"],[0,1],100,200,0,100,200,40).drawCircle(100,200,40);//Add the item to our stage, and call .tick(); to draw the object.varstage=newcreatejs.Stage(c);stage.addChild(shape);stage.tick();//Create a PNG file.fs.writeFile(__dirname+'/public/circle.png',c.toBuffer(),function(){createjs.Ticker.halt();});

About

A NodeJS compatible build of EaselJS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •