SpriteSheetHelper, a class to ease sprite sheet animation data generation
public function SpriteSheetHelper()
public function generateFromMovieClip(sourceMC:MovieClip, cols:uint, rows:uint, width:uint, height:uint, transparent:Boolean = false, backgroundColor:uint = 0):Vector.<Texture2DBase>
Generates and returns one or more "sprite sheets" BitmapTexture from a given movieClip
Parameters
| sourceMC:MovieClip — MovieClip: A movieclip with timeline animation
|
|
| cols:uint — uint: Howmany cells along the u axis.
|
|
| rows:uint — uint: Howmany cells along the v axis.
|
|
| width:uint — uint: The result bitmapData(s) width.
|
|
| height:uint — uint: The result bitmapData(s) height.
|
|
| transparent:Boolean (default = false ) — Boolean: if the bitmapData(s) must be transparent.
|
|
| backgroundColor:uint (default = 0 ) — uint: the bitmapData(s) background color if not transparent.
|
Returns | Vector.<Texture2DBase> — Vector.<Texture2DBase> The generated Texture2DBase vector for the SpriteSheetMaterial.
|
public function generateSpriteSheetClipNode(animID:String, cols:uint, rows:uint, mapCount:uint = 1, from:uint = 0, to:uint = 0):SpriteSheetClipNode
Returns a SpriteSheetClipNode to pass to animator from animation id , cols and rows.
Parameters
| animID:String — String:The name of the animation
|
|
| cols:uint — uint: Howmany cells along the u axis.
|
|
| rows:uint — uint: Howmany cells along the v axis.
|
|
| mapCount:uint (default = 1 ) — uint: If the same animation is spread over more bitmapDatas. Howmany bimapDatas. Default is 1.
|
|
| from:uint (default = 0 ) — uint: The offset start if the animation first frame isn't in first cell top left on the map. zero based. Default is 0.
|
|
| to:uint (default = 0 ) — uint: The last cell if the animation last frame cell isn't located down right on the map. zero based. Default is 0.
|
Returns | SpriteSheetClipNode — SpriteSheetClipNode SpriteSheetClipNode: The SpriteSheetClipNode filled with the data
|
Thu Jul 11 2013, 08:55 PM +01:00