PixelBlitz engine v1.0

The PixelBlitz engine is a bitmap blit engine API that aims to be easy to use and very extendable.
“So what exactly is a bitmap blit engine?”
Bitmap blitting is the process of drawing everything to offscreen bitmaps and then rendering one bitmap to display the visual elements. The end result of this is speed. It is much faster than using the traditional display List approach, when doing anything that is graphically heavy.
Features
- Pixel-level collision detection
- Layer effects
- Horizontal and vertical scrolling
- Parallax scrolling
- Virtual timeline nearly identical to the MovieClip
- Memory efficient
- Fast, fast, fast
Demo
Press any key to switch to the next demo.
Project Home
I have created full documentation using ASDoc as well as several examples to get you started quickly. The project is located on GoogleCode at the link below.
PixelBlitz Project home
The project is licensed under the MIT license. That means you can use it for commercial purposes as well as non-commercial. I am hoping that many other developers will find this project useful.
- Norm

August 24th, 2008 at 10:31 pm
Great work! Thank you for sharing it!
Do you know how many times faster is to blitz than to use the regular display list?
August 25th, 2008 at 9:27 am
[...] Soule has released v1.0 of his new PixelBlitz Engine. It is a system for utilizing BitmapData to represent your MovieClips and Sprites. There are [...]
August 26th, 2008 at 2:04 pm
[...] Mar 2006Beitr
August 27th, 2008 at 10:01 am
Hi - Just playing with this now as it looks really interesting. One question I have so far: can a RenderLayer only contain one type of PixelSprite? because I created a PixelSprite, added it to a RenderLayer and it worked fine. Then I added a new PixelSprite (which used a different bitmap in my Library), added that to the same RenderLayer and I ended up with 2 copies of the first bitmap. Is this normal behaviour?
August 27th, 2008 at 10:33 am
Phew.. just had to install Flash Block so I could write another post on this page (your embedded demo above uses up 98% CPU in FF3 and locks my PC!) - ok I’ve tracked down the problem. Here is the code to replicate it:
player = new PixelSprite(new Bitmap(new playerBD(0, 0)));
player.x = 275;
player.y = 340;
layer.addItem(player);
baddie = new PixelSprite(new Bitmap(new invader1BD(0, 0)));
baddie.x = 275;
baddie.y = 100;
layer.addItem(baddie);
renderer.addLayer(layer);
addChild(renderer);
This will literally cause 2 of the first bitmap (the player) to appear. The cause of the problem is Line 88 of the PixelSprite class where you check to see if the class name already exists in the collection or not. The problem is that the class name for a Bitmap is Bitmap, so it always thinks it exists.
Fair enough I guess, it means I have to put the bitmap into a MovieClip in the library first, and then reference that.. but when I do so the resulting image is a cut off version of the original. I tracked this down to having the bitmap aligned to the center of the movieclip. If I top left align the bitmap it appears normal (but the registration point is then off!)
August 27th, 2008 at 11:18 am
@SP - most of my tests show it being up to 10 times faster, but it will vary based on how complicated the scene is.
@Richard Davey - Sorry for the cpu hog. I was trying to de-throttle the browsers. What you have pointed out is something I will be fixing as soon as possible. You are right the solution of putting the bitmap in a MovieClip works, but you should not have to do that. Thank you for pointing this out.
August 27th, 2008 at 11:32 am
Are you interested in any code contributions towards the project? The more I play with it, the more I like how it works - but there’s definitely room for expansion and speeding up
August 27th, 2008 at 11:39 am
@Richard Davey - Absolutely. That is one of things I am hoping for with this. I feel it does have tremendous potential, but I am only one person. You can shoot me an email at norm[at]redroostergames.com.
August 27th, 2008 at 1:15 pm
[...] Soule has released the first version of PixelBlitz, his 2D AS3 library that’s geared towards helping you create fast 2D “sprite” [...]
August 31st, 2008 at 5:12 pm
I’ve been trying to add Rotation to PixelSprite, with almsot 100% success.
The strategy is to have a rotation property and a rotatedBitmapData variable.
When the rotation is set, it redraws the bitmapData into rotatedBitmapData using matrix transformations to rotate the bitmap.
Then, in order for everything to work as before, change the bitmapData variable to _bitmapData, and have make a bitmapData property to return rotatedBitmapData.
I got this to work, but I can’t make it to rotate smoothly around the center.
I found the transformations at: http://www.8bitrocket.com/newsdisplay.aspx?newspage=6765
Maybe you’ll have better luck than me.
I’ll be happy to send you what I tried.
PS: I wish you’d made the project only in AS3 so it’d be easily put into FlashDevelop. Adobe Flash is real expensive.
September 18th, 2008 at 3:30 am
Hey Norm, so glad I just found this. I had been looking to possibly re-write the Diesel Engine that Jesse Warden had written a while back. This looks to be really awesome and I’d like to also contribute potentially to the code as well. Thanks for publishing this and the great work!
Cheers,
Dave K
September 23rd, 2008 at 9:51 am
Hi Norm,
Really appreciate the effort en energy u put in to this! Great stuff. I was wondering if u already looked at dynamic stage resize functionallity.
Thanks,
Ian
February 18th, 2009 at 6:47 am
Hi there,
heads up for the great work!
I just wanted to request a quick demo on how to use the Camera object, as i am having some issues on making it behave as i would like/expect.
Could you share a quick example of how to use one main sprite and tie it as the cam’s target to update background layers?
March 9th, 2009 at 6:29 am
Hi!
Nice engine! I just finished a game using this same method but without using this engine. It was only after that when I realized that it’s available
I’ll absolutely use it in my next project as bitmap blitting is the future of action and shooter type flash games.
April 20th, 2009 at 10:52 pm
Hi Norm, I have made a small mod to PixelBlitz which allows you to set an alpha value on a PixelSprite. Would you like to see it? How can I get the code to you?
July 13th, 2009 at 4:30 pm
This is really great! but Im having trouble controlling movieclips that instantiate classes. could anyone show me an example that does this
July 14th, 2009 at 1:16 pm
the camera target should be restricted to values inside the boundaries. if it goes too high it should be set to the maximum value. I say this because I have a tile-based engine where if you scroll passed the first tile they zip to the other side to form those tiles, the algorithm I’m using is tied with the camera target Point and when the camera stops the tiles keep going.