Friday, December 5, 2008

Introducing the BlitClip!

Yeeesh, it's been about six months since my last post, I guess it's because of schoolwork and things, but anyway I wanted to come back with a bang and release a new class called BlitClip for Actionscript 3 developers.

Ahem, ever wanted to make a MovieClip but not been able to because you don't own the Flash IDE? Fear no more, the BlitClip class is here! 

The BlitClip class utilizes the pixel blitting technique described by 8bitrocket here:

And creates a MovieClip-esque object by passing it a horizontal tile sheet, tile width, tile height, and optionally a registration point for the object (by default it's 0,0). If you wanted to center the registration point, pass in half the tile's width, and half the tile's height.

It behaves exactly like you would expect a MovieClip to behave with no scene support but frankly I never really viewed that as a needed feature ;)

The way it works is by using the tile sheet as frames, dividing it up by the tile width x tile height, and copypixeling one 'frame' of it to the main bitmap. If you're really interested you can take a peek at the source code, it's licensed under the GNU General Public License so you're free to do whatever you want (for the most part) as long as you post any modified versions under this license.

Here it is, source code, readme, and the license included: