PackagedragonBones.factorys
Classpublic class StarlingFactory
InheritanceStarlingFactory Inheritance BaseFactory Inheritance flash.events.EventDispatcher

A StarlingFactory instance manages the set of armature resources for the starling DisplayList. It parses the raw data (ByteArray), stores the armature resources and creates armature instances.

Create an instance of the StarlingFactory class that way:

     import flash.events.Event; 
     import dragonBones.factorys.BaseFactory;
     
     [Embed(source = "../assets/Dragon2.png", mimeType = "application/octet-stream")]  
     private static const ResourcesData:Class;
     var factory:StarlingFactory = new StarlingFactory(); 
     factory.addEventListener(Event.COMPLETE, textureCompleteHandler);
     factory.parseData(new ResourcesData());
     

See also

dragonBones.Armature


Public Properties
 PropertyDefined By
  generateMipMaps : Boolean
Whether to generate mapmaps (true) or not (false).
StarlingFactory
  optimizeForRenderToTexture : Boolean
Whether to optimize for rendering (true) or not (false).
StarlingFactory
  scaleForTexture : Number
Apply a scale for SWF specific texture.
StarlingFactory
Public Methods
 MethodDefined By
  
Creates a new StarlingFactory instance.
StarlingFactory
 Inherited
addSkeletonData(skeletonData:SkeletonData, name:String = null):void
Add a SkeletonData instance to this BaseFactory instance.
BaseFactory
 Inherited
addTextureAtlas(textureAtlas:Object, name:String = null):void
Add a textureAtlas to this BaseFactory instance.
BaseFactory
 Inherited
buildArmature(armatureName:String, animationName:String = null, skeletonName:String = null, textureAtlasName:String = null):Armature
Build and returns a new Armature instance.
BaseFactory
 Inherited
dispose(disposeData:Boolean = true):void
Cleans up resources used by this BaseFactory instance.
BaseFactory
 Inherited
Returns a SkeletonData instance.
BaseFactory
 Inherited
getTextureAtlas(name:String):Object
Return the TextureAtlas by that name.
BaseFactory
 Inherited
getTextureDisplay(textureName:String, textureAtlasName:String = null, pivotX:Number, pivotY:Number):Object
Return the TextureDisplay.
BaseFactory
 Inherited
parseData(bytes:ByteArray, skeletonName:String = null):SkeletonData
Parses the raw data and returns a SkeletonData instance.
BaseFactory
 Inherited
removeSkeletonData(name:String):void
Remove a SkeletonData instance from this BaseFactory instance.
BaseFactory
 Inherited
removeTextureAtlas(name:String):void
Remove a textureAtlas from this baseFactory instance.
BaseFactory
Protected Methods
 MethodDefined By
  
[override] Generates an Armature instance.
StarlingFactory
  
[override] Generates a Bone instance.
StarlingFactory
  
generateTextureAtlas(content:Object, textureAtlasXML:XML):Object
[override]
StarlingFactory
  
generateTextureDisplay(textureAtlas:Object, fullName:String, pivotX:Number, pivotY:Number):Object
[override] Generates a starling DisplayObject
StarlingFactory
Events
 Event Summary Defined By
 InheritedDispatched after a sucessful call to parseData().BaseFactory
Property Detail
generateMipMapsproperty
public var generateMipMaps:Boolean

Whether to generate mapmaps (true) or not (false).

optimizeForRenderToTextureproperty 
public var optimizeForRenderToTexture:Boolean

Whether to optimize for rendering (true) or not (false).

scaleForTextureproperty 
public var scaleForTexture:Number

Apply a scale for SWF specific texture. Use 1 for no scale.

Constructor Detail
StarlingFactory()Constructor
public function StarlingFactory()

Creates a new StarlingFactory instance.

Method Detail
generateArmature()method
override protected function generateArmature():Armature

Generates an Armature instance.

Returns
Armature — Armature An Armature instance.
generateBone()method 
override protected function generateBone():Bone

Generates a Bone instance.

Returns
Bone — Bone A Bone instance.
generateTextureAtlas()method 
override protected function generateTextureAtlas(content:Object, textureAtlasXML:XML):Object

Parameters

content:Object
 
textureAtlasXML:XML

Returns
Object
generateTextureDisplay()method 
override protected function generateTextureDisplay(textureAtlas:Object, fullName:String, pivotX:Number, pivotY:Number):Object

Generates a starling DisplayObject

Parameters

textureAtlas:Object — The TextureAtlas.
 
fullName:String — A qualified name.
 
pivotX:Number — A pivot x based value.
 
pivotY:Number — A pivot y based value.

Returns
Object