pixi-dragonbones-runtime
Version:
DragonBones Runtime for Pixi.js
3 lines (2 loc) • 1.52 kB
JavaScript
import{BaseObject as t}from"../core/BaseObject.mjs";import"../core/DragonBones.mjs";import{Rectangle as e}from"../geom/Rectangle.mjs";import"../geom/Transform.mjs";class r extends t{constructor(){super(...arguments),this.textures={}}_onClear(){for(let t in this.textures)this.textures[t].returnToPool(),delete this.textures[t];this.autoSearch=!1,this.width=0,this.height=0,this.scale=1,this.name="",this.imagePath=""}copyFrom(t){this.autoSearch=t.autoSearch,this.scale=t.scale,this.width=t.width,this.height=t.height,this.name=t.name,this.imagePath=t.imagePath;for(let t in this.textures)this.textures[t].returnToPool(),delete this.textures[t];for(let e in t.textures){const r=this.createTexture();r.copyFrom(t.textures[e]),this.textures[e]=r}}addTexture(t){t.name in this.textures?console.warn("Same texture: "+t.name):(t.parent=this,this.textures[t.name]=t)}getTexture(t){return t in this.textures?this.textures[t]:null}}class s extends t{constructor(){super(...arguments),this.region=new e,this.frame=null}static createRectangle(){return new e}_onClear(){this.rotated=!1,this.name="",this.region.clear(),this.parent=null,this.frame=null}copyFrom(t){this.rotated=t.rotated,this.name=t.name,this.region.copyFrom(t.region),this.parent=t.parent,null===this.frame&&null!==t.frame?this.frame=s.createRectangle():null!==this.frame&&null===t.frame&&(this.frame=null),null!==this.frame&&null!==t.frame&&this.frame.copyFrom(t.frame)}}export{r as TextureAtlasData,s as TextureData};
//# sourceMappingURL=TextureAtlasData.mjs.map