Skip to content

Commit

Permalink
Add dragonbones api about armatureKey, which is regard as 'dragonbone…
Browse files Browse the repository at this point in the history
…sName' (#4100)

* Add dragonbones  api about armatureKey, which is regard as dragonbonesName.

* Add dragonbones  api about armatureKey, which is regard as dragonbonesName.
  • Loading branch information
sunnylanwanjun authored and jareguo committed Mar 25, 2019
1 parent 5220bc1 commit b06b8b9
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion extensions/dragonbones/ArmatureDisplay.js
Expand Up @@ -451,6 +451,21 @@ let ArmatureDisplay = cc.Class({
this._updateDebugDraw();
},

/**
* !#en
* The key of dragonbones cache data, which is regard as 'dragonbonesName', when you want to change dragonbones cloth.
* !#zh
* 缓存龙骨数据的key值,换装的时会使用到该值,作为dragonbonesName使用
* @method getArmatureKey
* @example
* let factory = dragonBones.CCFactory.getInstance();
* let needChangeSlot = needChangeArmature.armature().getSlot("changeSlotName");
* factory.replaceSlotDisplay(toChangeArmature.getArmatureKey(), "armatureName", "slotName", "displayName", needChangeSlot);
*/
getArmatureKey () {
return this._armatureKey;
},

onRestore () {
// Destroyed and restored in Editor
if (!this._material) {
Expand All @@ -469,7 +484,7 @@ let ArmatureDisplay = cc.Class({
*
* @method setAnimationCacheMode
* @param {AnimationCacheMode} cacheMode
* * @example
* @example
* armatureDisplay.setAnimationCacheMode(dragonBones.ArmatureDisplay.AnimationCacheMode.SHARED_CACHE);
*/
setAnimationCacheMode (cacheMode) {
Expand Down

0 comments on commit b06b8b9

Please sign in to comment.