Sunday, November 23, 2014

Open Source and Free Voxel Editors


Ken Silverman's open source voxlap engine. It has a real-time WYSIWYG editor - VOXED for editing the game map.
Source Code:
see also Ken Silverman's EVALDRAW: 
and Ken Silverman's PND3D demo, an abandoned successor to the famous voxel engine Voxlap:

Strip to Voxel
A program to convert an image strip, or series of pictures in a long film strip like image, into a raw voxel model for later editing.

Slab6 & POLY2VOX
An open source 6-degree of freedom viewer and editor for KVX and VOX voxel files.
The utility POLY2VOX is a polygon to voxel model converter.
See also (Poly2Vox UNLIMITED, onverts textured .3DS files to voxels over size 256.)
and (3D mesh voxelizer).

An open source FPS game inspired by Wolfenstein 3D using Ken Silverman's VOXLAP engine to render voxels. The game package contains a animator tool for editing voxel animations.

Includes tools for VOX - a file format that describes an object built with voxels.
Source Code:

A free lightweight 8-bit voxel editor and renderer with lots of functionalities.

A cross-platform open-source voxel editor and tool chain that supports per-frame animation.
Source Code (MIT):

A voxel editor written in C#.
Source Code:
Note:  This tool seems sophisticated, however, not much information can be found about it. You may need to contact the author for more details.

Sprite Voxel Editor
Sproxel (short for "Sprite Voxel Editor") is a 3d interface designed to let the user quickly create and edit voxel-based 3d models. The creation process and resulting geometry can be thought of as an extension to 2d pixel art.
Source Code(New BSD):

Voxel Builder
Voxel Builder is an open source tool for that lets anyone design and edit 3D voxel (cube) models easily, right in their web browser.
Source Code (BSD):
Similar tools and

Cube Kingdom
Cube Kingdom is an application that can be used to create 3D models out of blocks with the same size and dimension.

VoxelDesc is a voxel editor driven by a command line with 2.5D graphics and powerful scripting.
Source Code (Artistic License version 2):

Zoxel is a voxel editor designed for small models. Like a sprite editor, but in 3D.
Source Code (GNU GPL):

VoxelShop is an extremely intuitive and powerful software for OSX, Windows and Linux to modify and create voxel objects. It was designed from the ground up in close collaboration with artists.

Simple voxel editor based on .NET framework.

Cube Construct
3D Pixel Editor for iPad with source code.
Source code:
See also

Painting in 3D with voxels in the cloud using WebGL or the Android app.

An all-3D 3D terrain editor which enables you to simply interactively draw and manipulate terrains in 3D space. Since this is not based on height fields, you can easily create steep hills, overhangs or even tunnels.

A Minecraft level editor.

Import kv6 format voxel to Minecraft.

Voxel Section Editor
Open source voxel creation and editing tool for Command & Conquer Tiberian Sun and Command & Conquer Red Alert 2 voxel files.
See also

RadED is an experimental voxel editor for Doom circa 1993.
Source Code:
See also
Note: this tool is rather old and no binary available - you need to compile for yourself.

Polygon modelling tools support sculpting (For High-Resolution realistic Voxel model creation):

The free and open source 3D animation suite also has sculpt mode:

Lite version of ZBrush, the ideal ground on which to get started with digital sculpting.

SculptyPaint is a low polygon 3D creation tool original written for creating sculpts.

SharpConstruct is a 3D modeling program designed to let users paint depth on to polygon models in real-time. Unlike traditional modeling programs, SharpConstruct makes it easy to quickly model organic shapes.
See also and FiberMesh (Designing Freeform Surfaces with 3D Curves)

Open source (GPL) 3D sculpting application that provides an intuitive workflow for Windows and Linux.

Small but powerful 3D editor for 3D concept art, fast modeling and sculpting.One great feature is 3D poly brushes, which makes 3D modeling like 2D drawing.

Very easy to use free 3D modeling and animation tool by Autodesk. Starting from stick figures, you can sculpt the details, paint the textures and pose your models. Available for iOS, Android and Windows.

Create quickly and easily your 3D head from just two 2D photos:
see also

Sketch-based shape creation & free-form modeling tool:

truesculpt (Virtual sculpture for Android)
Mathematical models: 
2D/3D free generative art application:

MeshMixer: and
Voxel Paint in 3D with Oculus VR:


Friday, November 21, 2014

Open Source and Free Pixel Editors

A simple online web-based (HTML5) Sprite and Pixel art Editor. Offline version is also available.
Source Code:

A free online (Flash) app for creating pixel art.
See also

The famous open source alternative to Photoshop.
See this note for using GIMP as a pixel art editor.

A free powerful image and photo editing software.

A bitmap paint program specialized in 256-color drawing.
Source Code (GNU GPL):

A painting program to create pixel art and manipulate digital photos.
Source Code (GNU GPL):

A open source (but not 'free') pixel art editor for Mac OS X.
Source Code:

An open source animated sprite editor & pixel art tool.
Source Code (GNU GPL):
Note: Aseprite is open source but not 'free' since donation is required for downloading the pre-built binaries. However, it is open source so you can compile for the binary by yourself.


Tuesday, November 18, 2014

Get URL and Read URL Parameters in JavaScript, HaXe and AS3

Find the URL of the embedding page of a swf is a very basic way for domain locking flash games. Similar things can be done for JavaScript based online games. To get the URL, in JavaScript you can use

var myURL=document.URL;
In HaXe (targeting JavaScript or HTML5), you can use
var myURL:String=js.Browser.window.document;
In AS3, to find the path url of the swf, you can use
and for finding the path url of the embedding page, you can use"window.location.href");
Besides, it's common to see url parameters, for example: "" To read the parameters, in the above example, that is "1234", "somestr" and "someotherstr", in JavaScript, you can use the snippet provided by or the function given at
In HaXe, you can use the following HaXe function
//translated from
function getQueryVariable(variable):String
       var query:String =;
       var vars:Array = query.split("&");
       for ( i in 0...vars.length) {
               var pair:Array = vars[i].split("=");
               if(pair[0] == variable){return pair[1];}
In AS3, if the parameters are given in the path of the swf' url, for example, "", or if the parameters are declared in flashvars, then you can simply use "root.loaderInfo.parameters" object to access all the parameters, for example,
var myStr:String = root.loaderInfo.parameters.param1;
However, to read parameters of the embedding page' url, you still need the help of JavaScript, see the following pages for an example:


Saturday, November 15, 2014

Create a SWC for Flash & AS3 Projects from OpenFL

If your code is pure haxe, it's easy to generate an AS3 library swc file for your AS3 projects, as documented at

haxe -swf mylib.swc MyLibClasses --macro include('mypackage')
For example, to generate the "TextParser.swc" from "TextParser.hx", I used
haxe -swf TextParser.swc TextParser.hx
However, if your project is based on the OpenFL library, more efforts may be needed. Anyway, since you can compile your project to a swf, one ultimated way is to load the external swf at run time and get all public classes and methods inside using the "getDefinition" function from the "ApplicationDomain" class, see for example However, this way is not the most efficient and need you to write more code. For the most cases, it is possible to generate a swc file from your OpenFL based code. Things you need to do are
1. Rename the package name "openfl" to "flash", e.g., "openfl.display.Sprite" to "flash.display.Sprite".
2. Make your code independent of the openfl only classes and methods. For example, don't use "openfl.Assets.getBitmapData" directly in your code, use a external wrapper object as the assets host such as "myAssetsHost" and redirect all function calls to its public method which wraps "openfl.Assets.getBitmapData". Then in your AS3 project, you can reimplement the wrapper object using AS3 methods for handling assets.
An example is the JiuGongGe.swc, I refactored the original source code to make it independent of "openfl.Assets". It also depends on the library "Actuate", so I copied the library folder "motion" from the installed path "D:\HaxeToolkit\haxe\lib\actuate\1,7,5\motion" to the folder contains the source code of JiuGongGe, then use the command
haxe -swf JiuGongGe.swc JGG.hx  --no-traces --macro include('motion.Actuate')
to get the swc file.


Tuesday, November 11, 2014

TextParser - A Simple Class for Parsing Text Files

TextParser is a simple utility HaXe class for parsing text files. You can use this class to read String, Int variables from a text file. For example, the JiuGongGe UI uses a text file to configure the UI layout, so it needs to parse the text configuration file to do the set up.

The source code of the class is released with the JiuGongGe UI:
TextParser is also available in AS3 as a swc:
To use the class, add the following line in your main class first:


The following is a simple AS3 example for using the TextParser class to parse a text file line by line and read some strings and integers needed:
var myUILayout:ByteArray = new myUILayoutClass() as ByteArray;
var myTextParser:TextParser = new TextParser(myUILayout.toString());
while (!myTextParser.EndofFile())
var Name:String = myTextParser.ReadString();
if (Name == "#") //comment line
var CallBackStr:String = myTextParser.ReadString();
var IconStr:String = myTextParser.ReadString();
var Color:uint = myTextParser.ReadInteger();
var Label:String = myTextParser.ReadString();
var LevelStr:String = myTextParser.ReadString();
Basically, you need to put the parsing process inside a while loop. Where the function EndofFile() is used to check whether it is the end of the text file. The function GotoNextLine() will move the position of the file pointer to the next line. The functions ReadString() and ReadInteger() are used to read string and integer from the text file and update the file pointer's position.

Full source code for the example:

For a HaXe code example, please check the JiuGongGe UI's source code. 

Monday, November 10, 2014

JiuGongGe.swc - JiuGongGe UI for Flash AS3 Projects

For using the JiuGongGe UI in your Flash/AS3 projects, here is the pre-compiled swc file:
An example FlashDevelop project:

To use "JiuGongGe.swc", first add the swc file to your project's library (path). Since the swc is built directly from original HaXe source code, there're two requirements:
1. Your main class must be a sub-class of "MovieClip" instead of "Sprite".
2. Add the following code before using the "JGG" class:


Check the post for how to using the UI library - most of the HaXe code in the post also works in Flash. Note that the function "Assets.getText()" and "Assets.getBitmapData()" are provided by OpenFL, so you may need to embed the assets in your AS3 code like the example Flash project.

Wednesday, November 5, 2014

JiuGongGe UI - A Simple Open Source UI Framework in HaXe

JiuGongGe (means 9-cell) UI is a UI framework written in HaXe with OpenFL for all platforms, including Flash, HTML5, Android/iOS and Windows. This UI framework is designed to be lightweight and mobile friendly.

The framework is actually a set of buttons (clickable cells) in a nested hierarchy, with each level containing at most 9 cells. The UI framework is firstly created for the BNote application.

Basic Usage
The framework contains two main classes, "JGGCell" represents a single cell and "JGG" is the whole set of cells. You can customize the look and feel for the cells by modifying and extending the first class. For the most time, you're working with the second class. Firstly, you need to create an instance of the "JGG" class, which is a subclass of "Sprite", so you can add it to the stage and set the positions:

var myJGG:JGG = new JGG();
myJGG.x = 300;
myJGG.y = 200;
But nothing happens until you initialize the UI:
Where the first parameter is the UI host,usually the parent of the the UI object. All event handler function of the click event triggered by cells should be declared in the UI host as public functions. For example, if you use the stage as the UI host, the following function in your Main class can be used as on click event handler:
public function CallBack(event:Event)

The second parameter is the assets host, which will provide the UI framework with icons. The assets host must implement the function "getIcon(ID:String):DisplayObject" as a public method, which will be called by the JGG class to fetch icon resources. For example:
public function getIcon(ID:String)
  return new Bitmap(Assets.getBitmapData("assets/" + ID));
The return value can be a Bitmap, Sprite, or any other display object.

The third parameter is the String of the config file. The cells' hierarchy is declared in the string. Usually, it's better to write the config file in a text file, then you can use "Assets.getText" to get the string and pass it to the JGG's init function, other than directly embed the string content in your code. For each line of the config file, you declare one cell and specify the cell's property. It's not necessary to give all the 9 cells for a level. Just declare used cells only. You should give the following things (with out the "[" and "]") in order and delimited by space:
[name_of_cell] [on_click_callback_function_name] [background_color] [icon] [text_label] [index][newline] 
Note strictly one row for one cell, and no spaces within [...] - use "_" or "-" instead. For example,
StartCell JGG_ChangeLevel 0xffffff null Start 0
You can use "#" at the beginning of the line to comment:
# This is a comment line.

Now about some details of each property declaration.
[name_of_cell]: Will be used as the name of the JGGCell class instance. [on_click_callback_function_name]: Use the same name of the public method in the UI host. When the cell is clicked by user, this function will be called. You can use the shortcut string "JGG_ChangeLevel" for folding (for non-center cell)or unfolding (if it is the center cell) levels, without implementing the function in the UI host.
[background_color]: Background color of the cell, e.g., 0xffffff.
[icon]: An ID string used as a parameter of Assets host's public function "getIcon". Use the shortcut string "null" if you want to simply use a text label instead.
[text_label]: This is usually used for debugging or quick prototyping purpose. It's recommended use an icon instead of a text label. You can use "_" for space, "/" for newline in the label string. The label text will shown only if the icon string is "null".
[index]: To give the level information of the cell. For example "0,1,0" - integer sequence separated by ','. It is an array of indices for different levels. "0,1,0" means the cell's index in the root level is "0", in the first level is "1" and in the second level is "0". For each level, there're at most 9 cells, so the indices are all staring from "0" to "8". The cell's position is determined by the index of its last level. Starting from center as "0", go left as "1" then up as "2", then along a clockwise circle to "8".
How to interpret the index: Take "0,2,4,3,5" as an example. Look at the last (5-th) integer "5", it means the cell is in the 4-th level with index "5", so it's position is the center one on the right panel. Now the second last (4-th) integer "3", it means the cell's parent's index (in the 3-rd level) is 3. And the integer "4" means the cells' parent' parent's index is 4... In short, you can think the indices as an index of a multidimensional array, which specifies the position of the the cell in the hierarchy.

For a complete example of the config file, please check:

Advanced Usage
To change cells' behavior, customize cell's look and feel etc.: You can use public functions foldLevel() and unfoldLevel(TargetCell:JGGCell) to change the levels manually, and getCell(name:String) to get a specific cell. The JGGCell class is a subclass of Sprite, so you can redraw the cell using its Graphics property. See the example's source code for more details:

Although the UI framework is very simple, I believe it can satisfy the most needs for a simple application with some customization. For example, check the BNote app. However, if you're looking for a more feature complete UI framework in HaXe, try or

Flash demo:
HTML5 demo:
Real Example (BNote):
Source Code v0.2 (MIT):
SWC for Flash/AS3: