because there is still a todo for one last thing to support atlases it is not yet added to the api.
This for instance will accept atlasses, but will not work for compressed atlases.
Unlike Starling and probably other 2d api’s, we do not work with quads and build a 9 grid like for these cases. Because we apply on unknown geometry, we need handle the reconstruct of missing space via agal. Which is still on the todo.
In meanwhile, you can add this very early version of the method to tools.SpriteSheetHelper.as.
If you (have) follow(ed) the tutorials, that should make sens.
public function parseAtlasXml(animID:String, textureWidth:uint, textureHeight:uint, atlasXml:XML) : SpriteSheetAnimationSet
{
var spriteSheetAnimationSet:SpriteSheetAnimationSet = new SpriteSheetAnimationSet();
var node:SpriteSheetClipNode = new SpriteSheetClipNode();
node.name = animID;
spriteSheetAnimationSet.addAnimation(node);
var frame:SpriteSheetAnimationFrame;
var u:uint, v:uint,i:uint;
var scale:Number = 1;//mAtlasTexture.scale;
for each (var subTexture:XML in atlasXml.SubTexture)
{
var name:String = subTexture.attribute(“name”);
var x:Number = parseFloat(subTexture.attribute(“x”)) / scale;
var y:Number = parseFloat(subTexture.attribute(“y”)) / scale;
var width:Number = parseFloat(subTexture.attribute(“width”)) / scale;
var height:Number = parseFloat(subTexture.attribute(“height”)) / scale;
// var frameX:Number = parseFloat(subTexture.attribute(“frameX”)) / scale;
// var frameY:Number = parseFloat(subTexture.attribute(“frameY”)) / scale;
// var frameWidth:Number = parseFloat(subTexture.attribute(“frameWidth”)) / scale;
// var frameHeight:Number = parseFloat(subTexture.attribute(“frameHeight”)) / scale;
// var regionR:Rectangle = new Rectangle(x, y, width, height);
// var frameR:Rectangle = frameWidth > 0 && frameHeight > 0 ? new Rectangle(frameX, frameY, frameWidth, frameHeight) : null;
frame = new SpriteSheetAnimationFrame();
frame.offsetU = x / textureWidth;
frame.offsetV = y / textureHeight;
frame.scaleU = width / textureWidth;
frame.scaleV = height / textureHeight;
frame.mapID = i;
node.addFrame(frame, 16);
i++;
}
return spriteSheetAnimationSet;
}