diff --git a/DragonBones/src/dragonBones/core/DragonBones.ts b/DragonBones/src/dragonBones/core/DragonBones.ts index 9ac9f45f..009459c2 100644 --- a/DragonBones/src/dragonBones/core/DragonBones.ts +++ b/DragonBones/src/dragonBones/core/DragonBones.ts @@ -353,10 +353,6 @@ namespace dragonBones { } } // -if (typeof global === "undefined") { - var global = window as any; -} -// if (!console.warn) { console.warn = function () { }; } @@ -381,4 +377,21 @@ var __extends: any = function (t: any, e: any) { } } r.prototype = e.prototype, t.prototype = new (r as any)(); -}; \ No newline at end of file +}; +// +if (typeof global === "undefined") { + var global = window as any; +} +// +declare var exports: any; +declare var module: any; +declare var define: any; +if (typeof exports === "object" && typeof module === "object") { + module.exports = dragonBones; +} +else if (typeof define === "function" && define["amd"]) { + define(["dragonBones"], function () { return dragonBones; }); +} +else if (typeof exports === "object") { + exports["dragonBones"] = dragonBones; +} \ No newline at end of file diff --git a/Pixi/4.x/src/dragonBones/pixi/PixiTextureAtlasData.ts b/Pixi/4.x/src/dragonBones/pixi/PixiTextureAtlasData.ts index 310bac2e..80ddb09a 100644 --- a/Pixi/4.x/src/dragonBones/pixi/PixiTextureAtlasData.ts +++ b/Pixi/4.x/src/dragonBones/pixi/PixiTextureAtlasData.ts @@ -80,8 +80,8 @@ namespace dragonBones { textureData.renderTexture = new PIXI.Texture( this._renderTexture, - textureData.region as PIXI.Rectangle, // No need to set frame. - textureData.region as PIXI.Rectangle, + new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height), + new PIXI.Rectangle(textureData.region.x, textureData.region.y, textureData.region.width, textureData.region.height), new PIXI.Rectangle(0, 0, textureData.region.width, textureData.region.height), textureData.rotated as any // .d.ts bug );