Package | dragonBones |
Class | public class Bone |
Inheritance | Bone flash.events.EventDispatcher |
See also
Property | Defined By | ||
---|---|---|---|
armature : Armature [read-only]
The armature this Bone instance belongs to. | Bone | ||
childArmature : Armature [read-only]
The sub-armature of this Bone instance. | Bone | ||
colorTransform : ColorTransform
The ColorTransform instance assiociated with this Bone instance. | Bone | ||
display : Object
The DisplayObject belonging to this Bone instance. | Bone | ||
displayList : Array [read-only]
The DisplayObject list belonging to this Bone instance. | Bone | ||
global : BoneTransform
This Bone instance global Node instance. | Bone | ||
name : String
The name of this Bone instance's Armature instance. | Bone | ||
node : BoneTransform
This Bone instance Node Instance. | Bone | ||
origin : BoneTransform
This Bone instance origin Node Instance. | Bone | ||
parent : Bone [read-only]
Indicates the Bone instance that directly contains this Bone instance if any. | Bone | ||
userData : Object
An object that can contain any user extra data. | Bone | ||
visible : Object
Whether this Bone instance and its associated DisplayObject are visible or not (true/false/null). | Bone |
Method | Defined By | ||
---|---|---|---|
Bone(displayBrideg:IDisplayBridge)
Creates a new Bone instance and attaches to it a IDisplayBridge instance. | Bone | ||
changeDisplayList(displayList:Array):void
Change all DisplayObject attached to this Bone instance. | Bone | ||
Returns true if the passed Bone Instance is a child of this Bone instance (deepLevel false) or true if the passed Bone instance is in the child hierarchy of this Bone instance (deepLevel true) false otherwise. | Bone | ||
dispose():void
Cleans up any resources used by this Bone instance. | Bone |
armature | property |
armature:Armature
[read-only] The armature this Bone instance belongs to.
public function get armature():Armature
childArmature | property |
childArmature:Armature
[read-only] The sub-armature of this Bone instance.
public function get childArmature():Armature
colorTransform | property |
colorTransform:ColorTransform
The ColorTransform instance assiociated with this Bone instance. null means that the ColorTransform will be controled by animation data.
public function get colorTransform():ColorTransform
public function set colorTransform(value:ColorTransform):void
display | property |
display:Object
The DisplayObject belonging to this Bone instance. Instance type of this object varies from flash.display.DisplayObject to startling.display.DisplayObject and subclasses.
public function get display():Object
public function set display(value:Object):void
displayList | property |
displayList:Array
[read-only] The DisplayObject list belonging to this Bone instance.
public function get displayList():Array
global | property |
public var global:BoneTransform
This Bone instance global Node instance.
See also
name | property |
public var name:String
The name of this Bone instance's Armature instance.
node | property |
origin | property |
public var origin:BoneTransform
This Bone instance origin Node Instance.
See also
parent | property |
parent:Bone
[read-only] Indicates the Bone instance that directly contains this Bone instance if any.
public function get parent():Bone
userData | property |
public var userData:Object
An object that can contain any user extra data.
visible | property |
visible:Object
Whether this Bone instance and its associated DisplayObject are visible or not (true/false/null). null means that the visible will be controled by animation data.
public function get visible():Object
public function set visible(value:Object):void
Bone | () | Constructor |
public function Bone(displayBrideg:IDisplayBridge)
Creates a new Bone instance and attaches to it a IDisplayBridge instance.
ParametersdisplayBrideg:IDisplayBridge |
changeDisplayList | () | method |
public function changeDisplayList(displayList:Array):void
Change all DisplayObject attached to this Bone instance.
Parameters
displayList:Array — An array of valid DisplayObject to attach to this Bone.
|
contains | () | method |
public function contains(bone:Bone, deepLevel:Boolean = false):Boolean
Returns true if the passed Bone Instance is a child of this Bone instance (deepLevel false) or true if the passed Bone instance is in the child hierarchy of this Bone instance (deepLevel true) false otherwise.
Parameters
bone:Bone — Check against child heirarchy.
| |
deepLevel:Boolean (default = false )
|
Boolean —
|
dispose | () | method |
public function dispose():void
Cleans up any resources used by this Bone instance.
Download the example files here:
This example retrieves the Bone instance assiociated with the character's head and apply to its Display property an 0.5 alpha.
package { import dragonBones.Armature; import dragonBones.factorys.BaseFactory; import flash.display.Sprite; import flash.events.Event; public class DragonAnimation extends Sprite { [Embed(source = "Dragon1.swf", mimeType = "application/octet-stream")] private static const ResourcesData:Class; private var factory:BaseFactory; private var armature:Armature; public function DragonAnimation() { factory = new BaseFactory(); factory.addEventListener(Event.COMPLETE, handleParseData); factory.parseData(new ResourcesData(), 'Dragon'); } private function handleParseData(e:Event):void { armature = factory.buildArmature('Dragon'); addChild(armature.display as Sprite); armature.animation.play(); var bone:Bone = armature.getBone("head"); bone.display.alpha = 0.5;//make the DisplayObject belonging to this bone semi transparent. addEventListener(Event.ENTER_FRAME, updateAnimation); } private function updateAnimation(e:Event):void { armature.advanceTime(1 / stage.frameRate); } } }