Pixas Tutorial Series Part 1: Building Your First Application
In this part, I will show you how to build a brand new application with Pixas. Probably you have no idea what does this object mean but no worries, I just want to bring the idea that how easy this Engine works.
The project is hosted on GoogleCode:
Also, you can check out the code from GitHub:
After that, you should add the source folder to your global or project Classpaths.
Ok, let’s take it simple. If you have any preceding knowledge about pixel art, to create an isometric pixel cube must be the first show you would like to see. Here’s the code:
import com.risonhuang.pixas.objects.primitives.Cube; import com.risonhuang.pixas.objects.PixelObject; var cube:Cube = new Cube(); var po:PixelObject = new PixelObject(cube); po.x = 200; po.y = 150; addChild(po);
Cube is a type of Primitive, we create an instance of Cube, then assign it to the PixelObject’s constructor parameter.
The PixelObject holding all of the primitives is extended from Sprite, which means we can simply add it onto the stage.
Run this program and you will see this cube on your stage:
It’s really easy right? Let’s zoom in the cube to take a closer look at it:
Now we’ve made the first application work, and you can see all of the pixel lines arrange fine. In the next part, we will learn about the coordinate system.