Cocos Creator API

1.4.x

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

ArmatureDisplay

Module: dragonBones

The Armature Display of DragonBones

(Armature Display has a reference to a DragonBonesAsset and stores the state for ArmatureDisplay instance, which consists of the current pose's bone SRT, slot colors, and which slot attachments are visible.
Multiple Armature Display can use the same DragonBonesAsset which includes all animations, skins, and attachments.)

Properties

dragonAsset DragonBonesAsset

The DragonBones data contains the armatures information (bind pose bones, slots, draw order, attachments, skins, etc) and animations but does not hold any state.
Multiple ArmatureDisplay can share the same DragonBones data.

dragonAtlasAsset DragonBonesAtlasAsset

The atlas asset for the DragonBones.

armatureName String

The name of current armature.

animationName String

The name of current playing animation.

_defaultArmatureIndex Number

timeScale Number

The time scale of this armature.

playTimes Number

The play times of the default animation. -1 means using the value of config file; 0 means repeat for ever >0 means repeat times

debugBones Boolean

Indicates whether open debug bones.

_sgNode _ccsg.Node private

Reference to the instance of _ccsg.Node If it is possible to return null from your overloaded _createSgNode, then you should always check for null before using this property and reimplement __preload.

__eventTargets Array private

Inherited from Component:

Register all related EventTargets, all event callbacks will be removed in _onPreDestroy

node Node

Inherited from Component:

The node this component is attached to. A component is always attached to a node.

examples:

cc.log(comp.node);

uuid String readOnly

Inherited from Component:

The uuid for editor.

examples:

cc.log(comp.uuid);

_enabled Boolean private

Inherited from Component:

enabled Boolean

Inherited from Component:

indicates whether this component is enabled or not.

examples:

comp.enabled = true;
cc.log(comp.enabled);

enabledInHierarchy Boolean readOnly

Inherited from Component:

indicates whether this component is enabled and its node is also active in the hierarchy.

examples:

cc.log(comp.enabledInHierarchy);

_isOnLoadCalled Boolean readOnly

Inherited from Component:

TODO

examples:

cc.log(_isOnLoadCalled);

_name String private

_objFlags Number private

name String

The name of the object.

examples:

obj.name = "New Obj";

isValid Boolean readOnly

Indicates whether the object is not yet destroyed.

examples:

cc.log(obj.isValid);

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

Methods

playAnimation
(
  • animName
  • playTimes
)
dragonBones.AnimationState

Play the specified animation. Parameter animName specify the animation name. Parameter playTimes specify the repeat times of the animation. -1 means use the value of the config file. 0 means play the animation for ever.

0 means repeat times.

name type description
animName String
playTimes Number

returns:

type: dragonBones.AnimationState

getArmatureNames ( ) Array

Get the all armature names in the DragonBones Data.

returns: