All Projects → nosir → Obelisk.js

nosir / Obelisk.js

Licence: other
Build pixel isometric graphics with HTML5 canvas

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Obelisk.js

pixelino
Pixel-drawing app for iOS ✍️
Stars: ✭ 45 (-97.97%)
Mutual labels:  pixel-art, pixel
D Zone
An ambient life simulation driven by user activity within a Discord server
Stars: ✭ 466 (-78.94%)
Mutual labels:  pixel-art, canvas
vue-pixel-art
Vue Pixel Art is an easy way to draw your Pixel Arts. This project is refactored from CSS Collection - DotGen
Stars: ✭ 40 (-98.19%)
Mutual labels:  pixel-art, pixel
Pixel
A real-time collaborative canvas, inspired by Reddit Place
Stars: ✭ 26 (-98.83%)
Mutual labels:  pixel-art, pixel
Pixelorama
A free & open-source 2D sprite editor, made with the Godot Engine! Available on Windows, Linux, macOS and the Web!
Stars: ✭ 2,535 (+14.55%)
Mutual labels:  pixel-art, pixel
metal camera
iOS metal camera with GPU shaders.
Stars: ✭ 68 (-96.93%)
Mutual labels:  pixel-art, pixel
Pxltrm
🖌️ pxltrm - [WIP] A pixel art editor inside the terminal
Stars: ✭ 459 (-79.26%)
Mutual labels:  pixel-art, pixel
pixelart.js
punks.js - draw punk (pixel) art images using any design (in ascii text) in any colors; incl. 2x/4x/8x zoom for bigger sizes and more
Stars: ✭ 132 (-94.04%)
Mutual labels:  pixel-art, pixel
Pixel Editor
It edits pixels
Stars: ✭ 125 (-94.35%)
Mutual labels:  pixel-art, pixel
Icon Machine
Web application for randomly generating pixel art icons.
Stars: ✭ 73 (-96.7%)
Mutual labels:  pixel-art, canvas
vscode-luna-paint
A raster image editor extension for VS Code
Stars: ✭ 235 (-89.38%)
Mutual labels:  pixel-art, pixel
Vixl44
Create pixel art inside your terminal using vim movements
Stars: ✭ 152 (-93.13%)
Mutual labels:  pixel-art, pixel
ColorByNumber-iOS
Color by Number: a pixel coloring game on iOS.
Stars: ✭ 50 (-97.74%)
Mutual labels:  pixel-art, pixel
Pix
🎨 Pix is an online pixel art community where everyone can unleash their creativity on a 16x16 canvas, built with React-Native for iOS devices. 🚀
Stars: ✭ 86 (-96.11%)
Mutual labels:  pixel-art, pixel
8192px
A collaborative pixel art experiment
Stars: ✭ 64 (-97.11%)
Mutual labels:  pixel-art, pixel
Pixelcraft
A Pixel Art Editor
Stars: ✭ 413 (-81.34%)
Mutual labels:  pixel-art, canvas
Zombusters
🕹️ A retro style zombies shooter with cool isometric pixel art for Windows and MacOS
Stars: ✭ 41 (-98.15%)
Mutual labels:  pixel-art, isometric
Pixelizator
Swift/Python image pixelizer 🖼️.
Stars: ✭ 53 (-97.61%)
Mutual labels:  pixel-art, pixel
Rx
👾 Modern and minimalist pixel editor
Stars: ✭ 2,063 (-6.78%)
Mutual labels:  pixel-art, pixel
Filterous 2
Instagram-like photo manipulation library for Node.js and Javascript on browser
Stars: ✭ 163 (-92.63%)
Mutual labels:  pixel, canvas

Obelisk.js

GitHub release

obelisk.js is a JavaScript library for building isometric pixel objects.

With the simple and flexible API provided, you can easily add isometric pixel elements like brick, cube, pyramid and slope in HTML5 canvas. Obelisk.js strictly follows pixel neat pattern: lines with 1:2 pixel dot arrangement, leading to an angle of 22.6 degrees.

Also you should know obelisk.js is not for vector isometric graphics drawing and rendering. Internally it does not use any canvas graphic drawing API, instead, it manipulates all the rendering in pixel level to obtain precise pixel arrangement. Just try it out to pixelate something. Have fun.

1.2.0 Release

The newest version is written by CommonJS style, which means you can easily use it in browserify project. See details here

Showcase

Origin:

User Contributed:

Getting started

Simply include obelisk.js in your project

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

CDN url

https://unpkg.com/[email protected]/

In JavaScript

// create a canvas 2D point for pixel view world
var point = new obelisk.Point(200, 200);

// create view instance to nest everything
// canvas could be either DOM or jQuery element
var pixelView = new obelisk.PixelView(canvas, point);

// create cube dimension and color instance
var dimension = new obelisk.CubeDimension(80, 100, 120);
var gray = obelisk.ColorPattern.GRAY;
var color = new obelisk.CubeColor().getByHorizontalColor(gray);

// build cube with dimension and color instance
var cube = new obelisk.Cube(dimension, color, true);

// render cube primitive into view
pixelView.renderObject(cube);

For more details, check the tutorial part 1: To build the first cube, or try the code yourself

Tutorials

Step by step:

Sample code for building all primitives:

Development (Browser)

Browserify

Obelisk.js can be used from browserify project. Simply:

$ npm install obelisk.js

In your JavaScript

var obelisk = require('obelisk.js');

// Now you can do the same as above

Want to build the project locally?

$ git clone https://github.com/nosir/obelisk.js.git
$ npm install

Build

$ gulp build

Develop

$ gulp browserify:watch

Advanced Usage (Node.js)

Node.js

Also you can use it in your Node.js canvas project

As node.js canvas dependency can be tricky to install (binary dependency on Cairo) we are not adding it as a project dependency. You will need to add the canvas dependency explicitly on your project:

$ npm install canvas
$ npm install obelisk.js

In your JavaScript

// load Node Canvas dependency
var Canvas = require('canvas');

// load obelisk.js module
// here we need the Canvas as a module parameter
var obelisk = require('obelisk.js')(Canvas);

// create a Node Canvas instance
var canvas = new Canvas(600,450);

// Use obelisk the same way you will use it in the browser ...

// Save canvas to a file
canvas.createPNGStream().pipe(fs.createWriteStream('./figure.png'));

For more details, check the Node.js Canvas example.

Get in Touch

Changelog

See details here: release notes.

References

Pixel art is a form of digital art, where images are edited and displayed on the pixel level. The isometric projection is commonly seen in games to provide a 3D view without using any real 3D processing.

License

Obelisk.js is released under the MIT License

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].