Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
akdcl committed Oct 14, 2016
1 parent 81a1a71 commit 7ffb451
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
11 changes: 6 additions & 5 deletions DragonBones/src/dragonBones/factories/BaseFactory.as
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
{
var dragonBonesData:DragonBonesData = null;
var armatureData:ArmatureData = null;

if (dragonBonesName)
{
dragonBonesData = _dragonBonesDataMap[dragonBonesName];
Expand Down Expand Up @@ -329,9 +330,9 @@
}
else
{
if (!displayData.texture)
if (!displayData.texture || dataPackage.textureAtlasName)
{
displayData.texture = _getTextureData(dataPackage.textureAtlasName, displayData.name);
displayData.texture = _getTextureData(dataPackage.textureAtlasName || dataPackage.dataName, displayData.name);
}

if (
Expand Down Expand Up @@ -708,7 +709,7 @@
):Boolean
{
const dataPackage:BuildArmaturePackage = new BuildArmaturePackage();
if (_fillBuildArmaturePackage(dataPackage, fromDragonBonesDataName, fromArmatreName, fromSkinName, fromDragonBonesDataName))
if (_fillBuildArmaturePackage(dataPackage, fromDragonBonesDataName, fromArmatreName, fromSkinName, null))
{
const fromArmatureData:ArmatureData = dataPackage.armature;
if (ifRemoveOriginalAnimationList)
Expand Down Expand Up @@ -776,7 +777,7 @@
public function replaceSlotDisplay(dragonBonesName:String, armatureName:String, slotName:String, displayName:String, slot:Slot, displayIndex:int = -1):void
{
const dataPackage:BuildArmaturePackage = new BuildArmaturePackage();
if (_fillBuildArmaturePackage(dataPackage, dragonBonesName, armatureName, null, dragonBonesName))
if (_fillBuildArmaturePackage(dataPackage, dragonBonesName, armatureName, null, null))
{
const slotDisplayDataSet:SlotDisplayDataSet = dataPackage.skin.getSlot(slotName);
if (slotDisplayDataSet)
Expand Down Expand Up @@ -805,7 +806,7 @@
public function replaceSlotDisplayList(dragonBonesName:String, armatureName:String, slotName:String, slot:Slot):void
{
const dataPackage:BuildArmaturePackage = new BuildArmaturePackage();
if (_fillBuildArmaturePackage(dataPackage, dragonBonesName, armatureName, null, dragonBonesName))
if (_fillBuildArmaturePackage(dataPackage, dragonBonesName, armatureName, null, null))
{
const slotDisplayDataSet:SlotDisplayDataSet = dataPackage.skin.getSlot(slotName);
if (slotDisplayDataSet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ package dragonBones.starling
* @language zh_CN
* 获取带有指定贴图的显示对象。
* @param textureName 指定的贴图名称。
* @param dragonBonesName 指定的龙骨数据名称,如果未设置,将检索所有的龙骨数据
* @param textureAtlasName 指定的贴图集数据名称,如果未设置,将检索所有的贴图集数据
* @version DragonBones 3.0
*/
public function getTextureDisplay(textureName:String, textureAtlasName:String = null):Image
Expand Down
10 changes: 5 additions & 5 deletions Starling/Starling_1.x/src/dragonBones/starling/StarlingSlot.as
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,7 @@
const textureAtlasTexture:Texture = (currentTextureData.parent as StarlingTextureAtlasData).texture;
if (textureAtlasTexture)
{
if (!currentTextureData.texture)
{
currentTextureData.texture = new SubTexture(textureAtlasTexture, currentTextureData.region, false, null, currentTextureData.rotated);
}
else if (this._armature._replacedTexture)
if (currentTextureData.texture)
{
const texture:Texture = (this._armature._replacedTexture as starling.textures.Texture) || currentTextureData.texture.parent;
if (currentTextureData.texture.parent != texture)
Expand All @@ -245,6 +241,10 @@
currentTextureData.texture = new SubTexture(textureAtlasTexture, currentTextureData.region, false, null, currentTextureData.rotated);
}
}
else
{
currentTextureData.texture = new SubTexture(textureAtlasTexture, currentTextureData.region, false, null, currentTextureData.rotated);
}
}

this._updatePivot(rawDisplayData, currentDisplayData, currentTextureData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
* @language zh_CN
* 获取带有指定贴图的显示对象。
* @param textureName 指定的贴图名称。
* @param dragonBonesName 指定的龙骨数据名称,如果未设置,将检索所有的龙骨数据
* @param textureAtlasName 指定的贴图集数据名称,如果未设置,将检索所有的贴图集数据
* @version DragonBones 3.0
*/
public function getTextureDisplay(textureName:String, textureAtlasName:String = null):Image
Expand Down
10 changes: 5 additions & 5 deletions Starling/Starling_2.x/src/dragonBones/starling/StarlingSlot.as
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,7 @@
const textureAtlasTexture:Texture = (currentTextureData.parent as StarlingTextureAtlasData).texture;
if (textureAtlasTexture)
{
if (!currentTextureData.texture)
{
currentTextureData.texture = new SubTexture(textureAtlasTexture, currentTextureData.region, false, null, currentTextureData.rotated);
}
else if (this._armature._replacedTexture)
if (currentTextureData.texture)
{
const texture:Texture = (this._armature._replacedTexture as starling.textures.Texture) || currentTextureData.texture.parent;
if (currentTextureData.texture.parent != texture)
Expand All @@ -257,6 +253,10 @@
currentTextureData.texture = new SubTexture(textureAtlasTexture, currentTextureData.region, false, null, currentTextureData.rotated);
}
}
else
{
currentTextureData.texture = new SubTexture(textureAtlasTexture, currentTextureData.region, false, null, currentTextureData.rotated);
}
}

this._updatePivot(rawDisplayData, currentDisplayData, currentTextureData);
Expand Down

0 comments on commit 7ffb451

Please sign in to comment.