Download Latest Version blitter.zip (5.6 kB)
Email in envelope

Get an email when there's a new version of Blitter

Home
Name Modified Size InfoDownloads / Week
README.txt 2012-09-21 1.5 kB
Flex Spritesheet Example.zip 2012-09-21 100.8 kB
blitter.zip 2012-09-21 5.6 kB
Totals: 3 Items   107.9 kB 0
Blitting Usage
==============

Creating SpriteSheets
---------------------

	var sprite:SpriteSheet = SpriteSheet.create(name:String, image:*, frameWidth:uint, frameHeight:uint, flipped:Boolean=false, trim:Boolean=true, fillColor:uint=0x00000000, transparent:Boolean=true, drawBounds:Boolean=false);

SpriteSheet.create() creates a new spritesheet.

Example :

	Spritesheet.create("Jones", new BMD_OR_BMP_REF, 64, 64, true, true);

Adding Animations
-----------------

	addSequence(sprite:String, label:String, col:uint, row:uint, colspan:uint=1, rowspan:uint=1, delay:uint=0, bounce:Boolean=false, reverse:Boolean=false);

SpriteSheet.addSequence() adds an animation sequence to a stored spritesheet.

Example:

	Spritesheet.addSequence("Jones", "walk", 0, 0, 1, 8, 2);

The BlitSprite
--------------

	new BlitSprite(sprite:String="", sequence:String="", flipped:Boolean=false, frame:int=0, rotation:uint=0);

This creates and returns a BlitSprite responsible for animation and rendering of an individual sprite.

Example:

	object.sprite = new BlitSprite("Jones", "idle");

Animation & Rendering
---------------------

When rendering, you have two methods available;

	Spritesheet.animate(blit:BlitSprite);

advances the animation by one frame for the sprite and

	SpriteSheet.draw(blit:BlitSprite, canvas:BitmapData, x:int=0, y:int=0, mergeAlpha:Boolean=true);

which draws the sprite onto a given canvas.
Source: README.txt, updated 2012-09-21