Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egret支持龙骨动画从图集中创建 #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Egret/4.x/src/dragonBones/egret/EgretTextureAtlasData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ namespace dragonBones {

if (this._renderTexture !== null) {
const bitmapData = this._renderTexture.bitmapData;
const textureAtlasWidth = this.width > 0.0 ? this.width : bitmapData.width;
const textureAtlasHeight = this.height > 0.0 ? this.height : bitmapData.height;
const textureAtlasWidth = bitmapData.width;
const textureAtlasHeight = bitmapData.height;
const textureOffsetX = this._renderTexture.$bitmapX;
const textureOffsetY = this._renderTexture.$bitmapY;

for (let k in this.textures) {
const scale = egret.$TextureScaleFactor;
Expand All @@ -98,7 +100,7 @@ namespace dragonBones {

if (textureData.rotated) {
textureData.renderTexture.$initData(
textureData.region.x * scale, textureData.region.y * scale,
textureOffsetX + textureData.region.x * scale, textureOffsetY + textureData.region.y * scale,
subTextureHeight * scale, subTextureWidth * scale,
0, 0,
subTextureHeight * scale, subTextureWidth * scale,
Expand All @@ -108,7 +110,7 @@ namespace dragonBones {
}
else {
textureData.renderTexture.$initData(
textureData.region.x * scale, textureData.region.y * scale,
textureOffsetX + textureData.region.x * scale, textureOffsetY + textureData.region.y * scale,
subTextureWidth * scale, subTextureHeight * scale,
0, 0,
subTextureWidth * scale, subTextureHeight * scale,
Expand Down Expand Up @@ -146,4 +148,4 @@ namespace dragonBones {
this.renderTexture = null;
}
}
}
}