ランキングに戻る

nosir/obelisk.js

JavaScript

Build pixel isometric graphics with HTML5 canvas

pixel-artpixelisometriccanvas
スター成長
スター
2.3k
フォーク
95
週間成長
Issue
6
1k2k
2013年9月2017年12月2022年4月2026年7月
成果物npmnpm install obelisk.js
README

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/obelisk.js@1.2.2/

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

関連リポジトリ
aseprite/aseprite

Animated sprite editor & pixel art tool (Windows, macOS, Linux)

C++animationpixel-art
aseprite.org
38.2k8.4k
kitao/pyxel

A retro game engine for Python

Rustcrates.ioOthergamegame-development
17.6k929
piskelapp/piskel

A simple web-based tool for Spriting and Pixel art.

JavaScriptnpmApache License 2.0javascriptpixel-art
piskelapp.com
12.7k908
Orama-Interactive/Pixelorama

Unleash your creativity with Pixelorama, a powerful and accessible open-source pixel art multitool. Whether you want to create sprites, tiles, animations, or just express yourself in the language of pixel art, this software will realize your pixel-perfect dreams with a vast toolbox of features. Available on Windows, Linux, macOS and the Web!

GDScriptMIT Licensegodot-enginegamedev
pixelorama.org
9.9k526
dicebear/dicebear

DiceBear is an avatar library for designers and developers. 🌍

VueMIT Licenseavatarpixel-art
dicebear.com
9.1k397
gelstudios/gitfiti

abusing github commit history for the lulz

PythonPyPIMIT Licensegitfitipython
8.4k1.1k
LibreSprite/LibreSprite

Animated sprite editor & pixel art tool -- Fork of the last GPLv2 commit of Aseprite

C++GNU General Public License v2.0pixel-artcplusplus
libresprite.github.io
8.1k518
PixiEditor/PixiEditor

PixiEditor is a Universal Editor for all your 2D needs

C#GNU Lesser General Public License v3.0csharpraster-graphics
pixieditor.net
7.9k323
ringhyacinth/Star-Office-UI

A pixel office for your OpenClaw: turn invisible work states into a cozy little space with characters, daily notes, and guest agents. Code under MIT; art assets for non-commercial learning only.

HTMLOtheragent-collaborationai-assistant
7.4k795
jvalen/pixel-art-react

Pixel art animation and drawing web app powered by React

JavaScriptnpmMIT Licensepixel-artanimation
pixelartcss.com
6k334
srizzon/git-city

Your GitHub profile as a 3D pixel art building in an interactive city

TypeScriptnpmGNU Affero General Public License v3.03dgithub
thegitcity.com
5.7k286
JannisX11/blockbench

Blockbench - A low poly 3D model editor

JavaScriptnpmGNU General Public License v3.03dminecraft
blockbench.net
5.7k460