All Projects → jdan → Isomer

jdan / Isomer

Licence: mit
Isomer is an easy-to-use graphics library for drawing isometric scenes.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to Isomer

awesome-canvas
Canvas资源库大全中文版。An awesome Canvas packages and resources.
Stars: ✭ 288 (-89.59%)
Mutual labels:  canvas
Ananas
An easy image editor integration for your Android apps.
Stars: ✭ 186 (-93.28%)
Mutual labels:  canvas
audio-oscilloscope
Audio oscilloscope in canvas.
Stars: ✭ 28 (-98.99%)
Mutual labels:  canvas
city-tour
A procedurally generated city built with WebGL and three.js
Stars: ✭ 57 (-97.94%)
Mutual labels:  canvas
js-confetti
JS Confetti library that supports emojis 🦄 🎉 ⚡️
Stars: ✭ 343 (-87.6%)
Mutual labels:  canvas
canvas-image-cover-position
Calculating image position for scaling it on the canvas.
Stars: ✭ 38 (-98.63%)
Mutual labels:  canvas
okeevis-render
a fast lightweight 2d graphic library
Stars: ✭ 22 (-99.2%)
Mutual labels:  canvas
UltraTypeBot
A fast, easy to use bot for NitroType.com
Stars: ✭ 24 (-99.13%)
Mutual labels:  canvas
ux-charts
Simple, responsive, modern Charts with zero dependencies
Stars: ✭ 22 (-99.2%)
Mutual labels:  canvas
Spotify-Cards-API
🚀 Unofficial Spotify PromoCards API
Stars: ✭ 13 (-99.53%)
Mutual labels:  canvas
react-starfield-animation
✨ Canvas-based starfield animation for React.
Stars: ✭ 82 (-97.04%)
Mutual labels:  canvas
pikaso
Seamless and headless HTML5 Canvas library
Stars: ✭ 23 (-99.17%)
Mutual labels:  canvas
canvas-color-tracker
A utility to track objects on a canvas by unique px color
Stars: ✭ 29 (-98.95%)
Mutual labels:  canvas
canvas-td
A fully featured tower defense game built with <canvas>.
Stars: ✭ 31 (-98.88%)
Mutual labels:  canvas
Pancake
Lightweight, Fast, Easy-to-use HTML5 2D game framework!
Stars: ✭ 79 (-97.14%)
Mutual labels:  canvas
JustDraw
A Test for Android Canvas Painting with JavaScript Engine
Stars: ✭ 42 (-98.48%)
Mutual labels:  canvas
cloud-native-isometric-icons
Isometric assets promoting Cloud Native & Continuous Delivery
Stars: ✭ 33 (-98.81%)
Mutual labels:  isometric-graphics
Simple Draw
A canvas you can draw on with different colors.
Stars: ✭ 256 (-90.75%)
Mutual labels:  canvas
jqCandlestick
jQuery plugin for creating line, bar and candlestick charts.
Stars: ✭ 13 (-99.53%)
Mutual labels:  canvas
repeat-editor
editor for live coding graphics
Stars: ✭ 17 (-99.39%)
Mutual labels:  canvas

isomer

An isometric graphics library for HTML5 canvas.

View the official project page or try it out.

About

Isomer is an easy-to-use graphics library for drawing isometric scenes.

var Shape = Isomer.Shape;
var Point = Isomer.Point;
var Color = Isomer.Color;
var red = new Color(160, 60, 50);
var blue = new Color(50, 60, 160);

iso.add(Shape.Prism(Point.ORIGIN, 3, 3, 1));
iso.add(Shape.Pyramid(Point(0, 2, 1)), red);
iso.add(Shape.Prism(Point(2, 0, 1)), blue);

output

Getting Started

First, grab a copy of Isomer here. Then, include the script wherever you see fit:

<script src="/path/to/isomer.min.js"></script>

After which you'll need to place a canvas in your document that we can later refer to. Be sure to give it a width and height.

<canvas width="800" height="600" id="art"></canvas>

Note (Optional): To improve the look of your canvas on retina displays, declare the width and height of your canvas element as double how you want it to appear. Then style your canvas with CSS to include the original dimensions.

#art {
  width: 400px;
  height: 300px;
}

At this point we can finally instantiate an Isomer object. Pass it a reference to your canvas like so:

var iso = new Isomer(document.getElementById("art"));

Now you're ready to start drawing!

Build

Isomer uses Gulp as a build tool. To build the project, first install the dependencies.

$ npm install

Then run npm run dist:

$ npm run dist    # or, alternatively, `gulp dist`

> [email protected] dist /Users/jordan/Projects/isomer
> gulp

[gulp] Using gulpfile ~/Projects/isomer/gulpfile.js
[gulp] Starting 'dist'...
[gulp] Version: webpack 1.7.3
           Asset     Size  Chunks             Chunk Names
./dist/isomer.js  23.1 kB       0  [emitted]  isomer
[gulp] Version: webpack 1.7.3
               Asset     Size  Chunks             Chunk Names
./dist/isomer.min.js  9.33 kB       0  [emitted]  isomer
[gulp] Finished 'dist' after 911 ms
[gulp] Starting 'default'...
[gulp] Finished 'default' after 6.2 μs

To generate isomer.js and isomer.min.js in the dist/ directory.

Develop

Isomer is developed using Webpack. Install dependencies and build the project like so:

$ npm install
$ npm run dist

test/index.html contains a basic testing page that draws various shapes. This page will load a unminified bundle with source maps.

The test script (accessible via npm test) uses webpack-dev-server to automatically rebuild Isomer on any file changes. This script also opens the testing page (located at http://localhost:2992/webpack-dev-server/) in your default browser. The testing page includes a live reload script to refresh when Isomer is rebuilt and notify if the code is not conform the styling conventions for Isomer.

$ npm test

> [email protected] test /Users/jordan/Projects/isomer
> gulp test

[Isomer] listening on http://localhost:2992/
webpack: wait until bundle finished: /webpack-dev-server/
Hash: ************
Version: webpack 1.8.2
Time: 432ms
    Asset     Size  Chunks             Chunk Names
isomer.js  59.5 kB       0  [emitted]  isomer
chunk    {0} isomer.js (isomer) 20.1 kB [rendered]
    [0] ./index.js 83 bytes {0} [built]
    [1] ./js/isomer.js 3.86 kB {0} [built]
    [2] ./js/canvas.js 729 bytes {0} [built]
    [3] ./js/color.js 2.68 kB {0} [built]
    [4] ./js/path.js 3.77 kB {0} [built]
    [5] ./js/point.js 2.44 kB {0} [built]
    [6] ./js/shape.js 5.47 kB {0} [built]
    [7] ./js/vector.js 1.05 kB {0} [built]
webpack: bundle is now VALID.

With node-canvas

Isomer also accepts the canvas provided by node-canvas, meaning you can generate 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);

More Info

For more info, check out the official project page.

MIT Licensed

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].