Skip to content

v0.2.1

Compare
Choose a tag to compare
@jdan jdan released this 04 May 01:44
· 52 commits to master since this release

Isomer is now built with Browserify!

Browserify allows you to use traditional require() statements in your code, which is then bundled. Development is now significantly easier and cleaner.

There are now two gulp tasks, build & release.

  • gulp build bundles the project using Browserify and produces build/isomer.js
  • gulp release minifies the build to build/isomer.min.js

The test page references isomer.js, and includes a livereload script to be used with beefy.

This means that you will need to rebuild the project with every change, but you can have beefy do this for you, as well as reload the testing page automatically.

$ npm install -g beefy
$ beefy index.js:build/isomer.js --live
listening on http://localhost:9966/

Navigate to http://localhost:9966/test/ to check it out.

This pattern also makes it easy for Isomer to work with node-canvas for generating isometric graphics on the command line.

var Canvas = require('canvas');
var canvas = new Canvas(400, 400);
var Isomer = require('isomer');   // npm install isomer
var fs = require('fs');
var out = fs.createWriteStream('output.png');

var iso = new Isomer(canvas);
iso.add(Isomer.Shape.Prism(Isomer.Point.ORIGIN));

canvas.pngStream().pipe(out);

With <3,
@jdan