@combos-fun/renderer-adapter 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,7 +81,7 @@ class SpriteAnimation {
81
81
 
82
82
  class Text extends pixi_js.Text {
83
83
  constructor(text, style) {
84
- super(text, style);
84
+ super({ text, style });
85
85
  }
86
86
  }
87
87
 
@@ -1 +1 @@
1
- {"version":3,"file":"renderer-adapter.cjs.js","sources":["../lib/Container.ts","../lib/Graphics.ts","../lib/NinePatch.ts","../lib/Sprite.ts","../lib/SpriteAnimation.ts","../lib/Text.ts","../lib/TilingSprite.ts"],"sourcesContent":["import { Container as PixiContainer } from 'pixi.js';\n\nexport default class Container extends PixiContainer {\n [propName: string]: any;\n}\n","import { Graphics as PixiGraphics } from 'pixi.js';\nexport default class Graphics extends PixiGraphics {\n [propName: string]: any;\n}\n","import { NineSliceSprite, Texture } from 'pixi.js';\n\nexport default class NinePatch extends NineSliceSprite {\n constructor(\n img: string | Texture,\n leftWidth: number,\n topHeight: number,\n rightWidth: number,\n bottomHeight: number,\n ) {\n const texture = typeof img === 'string' ? Texture.from(img) : img;\n super({\n texture,\n leftWidth,\n topHeight,\n rightWidth,\n bottomHeight,\n });\n }\n}\n","import { Texture as PixiTexture, Sprite as PixiSprite } from 'pixi.js';\n\nexport default class Sprite {\n _image: HTMLImageElement | PixiTexture = null;\n public sprite: PixiSprite;\n constructor(image: HTMLImageElement | PixiTexture) {\n this._image = image;\n if (image) {\n if (image instanceof HTMLImageElement) {\n this.sprite = PixiSprite.from(image);\n } else if (image instanceof PixiTexture) {\n this.sprite = new PixiSprite(image);\n }\n } else {\n this.sprite = new PixiSprite();\n }\n }\n set image(val) {\n if (this._image === val) {\n return;\n }\n\n if (val instanceof HTMLImageElement) {\n this.sprite.texture && this.sprite.texture.destroy(false);\n this.sprite.texture = PixiTexture.from(val);\n } else if (val instanceof PixiTexture) {\n this.sprite.texture = val;\n }\n this._image = val;\n }\n get image() {\n return this._image;\n }\n}\n","import { AnimatedSprite, Texture } from 'pixi.js';\n\nexport default class SpriteAnimation {\n animatedSprite: AnimatedSprite;\n constructor({ frames }: { frames: Texture[] }) {\n this.animatedSprite = new AnimatedSprite(frames);\n }\n play() {\n this.animatedSprite.play();\n }\n stop() {\n this.animatedSprite.stop();\n }\n gotoAndPlay(frameNumber: number) {\n this.animatedSprite.gotoAndPlay(frameNumber);\n }\n gotoAndStop(frameNumber: number) {\n this.animatedSprite.gotoAndStop(frameNumber);\n }\n set speed(val: number) {\n this.animatedSprite.animationSpeed = val;\n }\n get speed() {\n return this.animatedSprite.animationSpeed;\n }\n}\n","import { Text as PixiText } from 'pixi.js';\nimport type { TextStyle } from 'pixi.js';\n\nexport default class Text extends PixiText {\n constructor(text: string, style?: Partial<TextStyle>) {\n super(text, style);\n }\n}\n","import { Texture, TilingSprite as PixiTilingSprite } from 'pixi.js';\n\nexport default class TilingSprite {\n _image: HTMLImageElement | Texture | null = null;\n public tilingSprite: PixiTilingSprite;\n constructor(image: HTMLImageElement | Texture | null) {\n this._image = image;\n if (image instanceof HTMLImageElement) {\n this.tilingSprite = PixiTilingSprite.from(Texture.from(image));\n } else if (image instanceof Texture) {\n this.tilingSprite = PixiTilingSprite.from(image);\n } else {\n this.tilingSprite = PixiTilingSprite.from(Texture.EMPTY);\n }\n }\n set image(val: HTMLImageElement | Texture | null) {\n if (this._image === val) {\n return;\n }\n\n if (val instanceof HTMLImageElement) {\n this.tilingSprite.texture = Texture.from(val);\n } else if (val instanceof Texture) {\n this.tilingSprite.texture = val;\n }\n this._image = val;\n }\n get image() {\n return this._image;\n }\n}\n"],"names":["PixiContainer","PixiGraphics","NineSliceSprite","Texture","PixiSprite","PixiTexture","AnimatedSprite","PixiText","PixiTilingSprite"],"mappings":";;;;AAEc,MAAO,SAAU,SAAQA,iBAAa,CAAA;AAEnD;;ACHa,MAAO,QAAS,SAAQC,gBAAY,CAAA;AAEjD;;ACDa,MAAO,SAAU,S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,CAAC;QAChE;AAAO,aAAA,IAAI,KAAK,YAAYA,eAAO,EAAE;YACnC,IAAI,CAAC,YAAY,GAAGK,oBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;QAClD;aAAO;YACL,IAAI,CAAC,YAAY,GAAGA,oBAAgB,CAAC,IAAI,CAACL,eAAO,CAAC,KAAK,CAAC;QAC1D;IACF;IACA,IAAI,KAAK,CAAC,GAAsC,EAAA;AAC9C,QAAA,IAAI,IAAI,CAAC,MAAM,KAAK,GAAG,EAAE;YACvB;QACF;AAEA,QAAA,IAAI,GAAG,YAAY,gBAAgB,EAAE;YACnC,IAAI,CAAC,YAAY,CAAC,OAAO,GAAGA,eAAO,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/C;AAAO,aAAA,IAAI,GAAG,YAAYA,eAAO,EAAE;AACjC,YAAA,IAAI,CAAC,YAAY,CAAC,OAAO,GAAG,GAAG;QACjC;AACA,QAAA,IAAI,CAAC,MAAM,GAAG,GAAG;IACnB;AACA,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,MAAM;IACpB;AACD;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"renderer-adapter.cjs.js","sources":["../lib/Container.ts","../lib/Graphics.ts","../lib/NinePatch.ts","../lib/Sprite.ts","../lib/SpriteAnimation.ts","../lib/Text.ts","../lib/TilingSprite.ts"],"sourcesContent":["import { Container as PixiContainer } from 'pixi.js';\n\nexport default class Container extends PixiContainer {\n [propName: string]: any;\n}\n","import { Graphics as PixiGraphics } from 'pixi.js';\nexport default class Graphics extends PixiGraphics {\n [propName: string]: any;\n}\n","import { NineSliceSprite, Texture } from 'pixi.js';\n\nexport default class NinePatch extends NineSliceSprite {\n constructor(\n img: string | Texture,\n leftWidth: number,\n topHeight: number,\n rightWidth: number,\n bottomHeight: number,\n ) {\n const texture = typeof img === 'string' ? Texture.from(img) : img;\n super({\n texture,\n leftWidth,\n topHeight,\n rightWidth,\n bottomHeight,\n });\n }\n}\n","import { Texture as PixiTexture, Sprite as PixiSprite } from 'pixi.js';\n\nexport default class Sprite {\n _image: HTMLImageElement | PixiTexture = null;\n public sprite: PixiSprite;\n constructor(image: HTMLImageElement | PixiTexture) {\n this._image = image;\n if (image) {\n if (image instanceof HTMLImageElement) {\n this.sprite = PixiSprite.from(image);\n } else if (image instanceof PixiTexture) {\n this.sprite = new PixiSprite(image);\n }\n } else {\n this.sprite = new PixiSprite();\n }\n }\n set image(val) {\n if (this._image === val) {\n return;\n }\n\n if (val instanceof HTMLImageElement) {\n this.sprite.texture && this.sprite.texture.destroy(false);\n this.sprite.texture = PixiTexture.from(val);\n } else if (val instanceof PixiTexture) {\n this.sprite.texture = val;\n }\n this._image = val;\n }\n get image() {\n return this._image;\n }\n}\n","import { AnimatedSprite, Texture } from 'pixi.js';\n\nexport default class SpriteAnimation {\n animatedSprite: AnimatedSprite;\n constructor({ frames }: { frames: Texture[] }) {\n this.animatedSprite = new AnimatedSprite(frames);\n }\n play() {\n this.animatedSprite.play();\n }\n stop() {\n this.animatedSprite.stop();\n }\n gotoAndPlay(frameNumber: number) {\n this.animatedSprite.gotoAndPlay(frameNumber);\n }\n gotoAndStop(frameNumber: number) {\n this.animatedSprite.gotoAndStop(frameNumber);\n }\n set speed(val: number) {\n this.animatedSprite.animationSpeed = val;\n }\n get speed() {\n return this.animatedSprite.animationSpeed;\n }\n}\n","import { Text as PixiText } from 'pixi.js';\nimport type { TextStyle } from 'pixi.js';\n\nexport default class Text extends PixiText {\n constructor(text: string, style?: Partial<TextStyle>) {\n super({ text, style });\n }\n}\n","import { Texture, TilingSprite as PixiTilingSprite } from 'pixi.js';\n\nexport default class TilingSprite {\n _image: HTMLImageElement | Texture | null = null;\n public tilingSprite: PixiTilingSprite;\n constructor(image: HTMLImageElement | Texture | null) {\n this._image = image;\n if (image instanceof HTMLImageElement) {\n this.tilingSprite = PixiTilingSprite.from(Texture.from(image));\n } else if (image instanceof Texture) {\n this.tilingSprite = PixiTilingSprite.from(image);\n } else {\n this.tilingSprite = PixiTilingSprite.from(Texture.EMPTY);\n }\n }\n set image(val: HTMLImageElement | Texture | null) {\n if (this._image === val) {\n return;\n }\n\n if (val instanceof HTMLImageElement) {\n this.tilingSprite.texture = Texture.from(val);\n } else if (val instanceof Texture) {\n this.tilingSprite.texture = val;\n }\n this._image = val;\n }\n get image() {\n return this._image;\n }\n}\n"],"names":["PixiContainer","PixiGraphics","NineSliceSprite","Texture","PixiSprite","PixiTexture","AnimatedSprite","PixiText","PixiTilingSprite"],"mappings":";;;;AAEc,MAAO,SAAU,SAAQA,iBAAa,CAAA;AAEnD;;ACHa,MAAO,QAAS,SAAQC,gBAAY,CAAA;AAEjD;;ACDa,MAAO,SAAU,SAAQC,uBAAe,CAAA;IACpD,WAAA,CACE,GAAqB,EACrB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,YAAoB,EAAA;AAEpB,QAAA,MAAM,OAAO,GAAG,OAAO,GAAG,KAAK,QAAQ,GAAGC,eAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG;AACjE,QAAA,KAAK,CAAC;YACJ,OAAO;YACP,SAAS;YACT,SAAS;YACT,UAAU;YACV,YAAY;AACb,SAAA,CAAC;IACJ;AACD;;ACjBa,MAAO,MAAM,CAAA;AAGzB,IAAA,WAAA,CAAY,KAAqC,EAAA;QAFjD,IAAA,CAAA,MAAM,GAAmC,IAAI;AAG3C,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK;QACnB,IAAI,KAAK,EAAE;AACT,YAAA,IAAI,KAAK,YAAY,gBAAgB,EAAE;gBACrC,IAAI,CAAC,MAAM,GAAGC,cAAU,CAAC,IAAI,CAAC,KAAK,CAAC;YACtC;AAAO,iBAAA,IAAI,KAAK,YAAYC,eAAW,EAAE;gBACvC,IAAI,CAAC,MAAM,GAAG,IAAID,cAAU,CAAC,KAAK,CAAC;YACrC;QACF;aAAO;AACL,YAAA,IAAI,CAAC,MAAM,GAAG,IAAIA,cAAU,EAAE;QAChC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Sprite{constructor(e,i,r,s,n){super({texture:"string"==typeof e?t.Texture.from(e):e,leftWidth:i,topHeight:r,rightWidth:s,bottomHeight:n})}}class s extends t.Text{constructor(t,e){super(t,e)}}Object.defineProperty(exports,"Application",{enumerable:!0,get:function(){return t.Application}}),exports.Container=e,exports.Graphics=i,exports.NinePatch=r,exports.Sprite=class{constructor(e){this._image=null,this._image=e,e?e instanceof HTMLImageElement?this.sprite=t.Sprite.from(e):e instanceof t.Texture&&(this.sprite=new t.Sprite(e)):this.sprite=new t.Sprite}set image(e){this._image!==e&&(e instanceof HTMLImageElement?(this.sprite.texture&&this.sprite.texture.destroy(!1),this.sprite.texture=t.Texture.from(e)):e instanceof t.Texture&&(this.sprite.texture=e),this._image=e)}get image(){return this._image}},exports.SpriteAnimation=class{constructor({frames:e}){this.animatedSprite=new t.AnimatedSprite(e)}play(){this.animatedSprite.play()}stop(){this.animatedSprite.stop()}gotoAndPlay(t){this.animatedSprite.gotoAndPlay(t)}gotoAndStop(t){this.animatedSprite.gotoAndStop(t)}set speed(t){this.animatedSprite.animationSpeed=t}get speed(){return this.animatedSprite.animationSpeed}},exports.Text=s,exports.TilingSprite=class{constructor(e){this._image=null,this._image=e,e instanceof HTMLImageElement?this.tilingSprite=t.TilingSprite.from(t.Texture.from(e)):e instanceof t.Texture?this.tilingSprite=t.TilingSprite.from(e):this.tilingSprite=t.TilingSprite.from(t.Texture.EMPTY)}set image(e){this._image!==e&&(e instanceof HTMLImageElement?this.tilingSprite.texture=t.Texture.from(e):e instanceof t.Texture&&(this.tilingSprite.texture=e),this._image=e)}get image(){return this._image}};
1
+ "use strict";var t=require("pixi.js");class e extends t.Container{}class i extends t.Graphics{}class r extends t.NineSliceSprite{constructor(e,i,r,s,n){super({texture:"string"==typeof e?t.Texture.from(e):e,leftWidth:i,topHeight:r,rightWidth:s,bottomHeight:n})}}class s extends t.Text{constructor(t,e){super({text:t,style:e})}}Object.defineProperty(exports,"Application",{enumerable:!0,get:function(){return t.Application}}),exports.Container=e,exports.Graphics=i,exports.NinePatch=r,exports.Sprite=class{constructor(e){this._image=null,this._image=e,e?e instanceof HTMLImageElement?this.sprite=t.Sprite.from(e):e instanceof t.Texture&&(this.sprite=new t.Sprite(e)):this.sprite=new t.Sprite}set image(e){this._image!==e&&(e instanceof HTMLImageElement?(this.sprite.texture&&this.sprite.texture.destroy(!1),this.sprite.texture=t.Texture.from(e)):e instanceof t.Texture&&(this.sprite.texture=e),this._image=e)}get image(){return this._image}},exports.SpriteAnimation=class{constructor({frames:e}){this.animatedSprite=new t.AnimatedSprite(e)}play(){this.animatedSprite.play()}stop(){this.animatedSprite.stop()}gotoAndPlay(t){this.animatedSprite.gotoAndPlay(t)}gotoAndStop(t){this.animatedSprite.gotoAndStop(t)}set speed(t){this.animatedSprite.animationSpeed=t}get speed(){return this.animatedSprite.animationSpeed}},exports.Text=s,exports.TilingSprite=class{constructor(e){this._image=null,this._image=e,e instanceof HTMLImageElement?this.tilingSprite=t.TilingSprite.from(t.Texture.from(e)):e instanceof t.Texture?this.tilingSprite=t.TilingSprite.from(e):this.tilingSprite=t.TilingSprite.from(t.Texture.EMPTY)}set image(e){this._image!==e&&(e instanceof HTMLImageElement?this.tilingSprite.texture=t.Texture.from(e):e instanceof t.Texture&&(this.tilingSprite.texture=e),this._image=e)}get image(){return this._image}};
@@ -80,7 +80,7 @@ class SpriteAnimation {
80
80
 
81
81
  class Text extends Text$1 {
82
82
  constructor(text, style) {
83
- super(text, style);
83
+ super({ text, style });
84
84
  }
85
85
  }
86
86
 
@@ -1 +1 @@
1
- {"version":3,"file":"renderer-adapter.esm.js","sources":["../lib/Container.ts","../lib/Graphics.ts","../lib/NinePatch.ts","../lib/Sprite.ts","../lib/SpriteAnimation.ts","../lib/Text.ts","../lib/TilingSprite.ts"],"sourcesContent":["import { Container as PixiContainer } from 'pixi.js';\n\nexport default class Container extends PixiContainer {\n [propName: string]: any;\n}\n","import { Graphics as PixiGraphics } from 'pixi.js';\nexport default class Graphics extends PixiGraphics {\n [propName: string]: any;\n}\n","import { NineSliceSprite, Texture } from 'pixi.js';\n\nexport default class NinePatch extends NineSliceSprite {\n constructor(\n img: string | Texture,\n leftWidth: number,\n topHeight: number,\n rightWidth: number,\n bottomHeight: number,\n ) {\n const texture = typeof img === 'string' ? Texture.from(img) : img;\n super({\n texture,\n leftWidth,\n topHeight,\n rightWidth,\n bottomHeight,\n });\n }\n}\n","import { Texture as PixiTexture, Sprite as PixiSprite } from 'pixi.js';\n\nexport default class Sprite {\n _image: HTMLImageElement | PixiTexture = null;\n public sprite: PixiSprite;\n constructor(image: HTMLImageElement | PixiTexture) {\n this._image = image;\n if (image) {\n if (image instanceof HTMLImageElement) {\n this.sprite = PixiSprite.from(image);\n } else if (image instanceof PixiTexture) {\n this.sprite = new PixiSprite(image);\n }\n } else {\n this.sprite = new PixiSprite();\n }\n }\n set image(val) {\n if (this._image === val) {\n return;\n }\n\n if (val instanceof HTMLImageElement) {\n this.sprite.texture && this.sprite.texture.destroy(false);\n this.sprite.texture = PixiTexture.from(val);\n } else if (val instanceof PixiTexture) {\n this.sprite.texture = val;\n }\n this._image = val;\n }\n get image() {\n return this._image;\n }\n}\n","import { AnimatedSprite, Texture } from 'pixi.js';\n\nexport default class SpriteAnimation {\n animatedSprite: AnimatedSprite;\n constructor({ frames }: { frames: Texture[] }) {\n this.animatedSprite = new AnimatedSprite(frames);\n }\n play() {\n this.animatedSprite.play();\n }\n stop() {\n this.animatedSprite.stop();\n }\n gotoAndPlay(frameNumber: number) {\n this.animatedSprite.gotoAndPlay(frameNumber);\n }\n gotoAndStop(frameNumber: number) {\n this.animatedSprite.gotoAndStop(frameNumber);\n }\n set speed(val: number) {\n this.animatedSprite.animationSpeed = val;\n }\n get speed() {\n return this.animatedSprite.animationSpeed;\n }\n}\n","import { Text as PixiText } from 'pixi.js';\nimport type { TextStyle } from 'pixi.js';\n\nexport default class Text extends PixiText {\n constructor(text: string, style?: Partial<TextStyle>) {\n super(text, style);\n }\n}\n","import { Texture, TilingSprite as PixiTilingSprite } from 'pixi.js';\n\nexport default class TilingSprite {\n _image: HTMLImageElement | Texture | null = null;\n public tilingSprite: PixiTilingSprite;\n constructor(image: HTMLImageElement | Texture | null) {\n this._image = image;\n if (image instanceof HTMLImageElement) {\n this.tilingSprite = PixiTilingSprite.from(Texture.from(image));\n } else if (image instanceof Texture) {\n this.tilingSprite = PixiTilingSprite.from(image);\n } else {\n this.tilingSprite = PixiTilingSprite.from(Texture.EMPTY);\n }\n }\n set image(val: HTMLImageElement | Texture | null) {\n if (this._image === val) {\n return;\n }\n\n if (val instanceof HTMLImageElement) {\n this.tilingSprite.texture = Texture.from(val);\n } else if (val instanceof Texture) {\n this.tilingSprite.texture = val;\n }\n this._image = val;\n }\n get image() {\n return this._image;\n }\n}\n"],"names":["PixiContainer","PixiGraphics","PixiSprite","PixiTexture","PixiText","PixiTilingSprite"],"mappings":";;;AAEc,MAAO,SAAU,SAAQA,WAAa,CAAA;AAEnD;;ACHa,MAAO,QAAS,SAAQC,UAAY,CAAA;AAEjD;;ACDa,MAAO,SAAU,SAAQ,eAAe,CAAA;IACpD,WAAA,CACE,GAAqB,EACrB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,YAAoB,EAAA;AAEpB,QAAA,MAAM,OAAO,GAAG,OAAO,GAAG,KAAK,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG;AACjE,QAAA,KAAK,CAAC;YACJ,OAAO;YACP,SAAS;YACT,SAAS;YACT,UAAU;YACV,YAAY;AACb,SAAA,CAAC;IACJ;AACD;;ACjBa,MAAO,MAAM,CAAA;AAGzB,IAAA,WAAA,CAAY,KAAqC,EAAA;QAFjD,IAAA,CAAA,MAAM,GAAmC,IAAI;AAG3C,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK;QACnB,IAAI,KAAK,EAAE;AACT,YAAA,IAAI,KAAK,YAAY,gBAAgB,EAAE;gBACrC,IAAI,CAAC,MAAM,GAAGC,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,IAAI,CAAC,MAAM,GAAG,GAAG;IACnB;AACA,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,MAAM;IACpB;AACD;;;;"}
1
+ {"version":3,"file":"renderer-adapter.esm.js","sources":["../lib/Container.ts","../lib/Graphics.ts","../lib/NinePatch.ts","../lib/Sprite.ts","../lib/SpriteAnimation.ts","../lib/Text.ts","../lib/TilingSprite.ts"],"sourcesContent":["import { Container as PixiContainer } from 'pixi.js';\n\nexport default class Container extends PixiContainer {\n [propName: string]: any;\n}\n","import { Graphics as PixiGraphics } from 'pixi.js';\nexport default class Graphics extends PixiGraphics {\n [propName: string]: any;\n}\n","import { NineSliceSprite, Texture } from 'pixi.js';\n\nexport default class NinePatch extends NineSliceSprite {\n constructor(\n img: string | Texture,\n leftWidth: number,\n topHeight: number,\n rightWidth: number,\n bottomHeight: number,\n ) {\n const texture = typeof img === 'string' ? Texture.from(img) : img;\n super({\n texture,\n leftWidth,\n topHeight,\n rightWidth,\n bottomHeight,\n });\n }\n}\n","import { Texture as PixiTexture, Sprite as PixiSprite } from 'pixi.js';\n\nexport default class Sprite {\n _image: HTMLImageElement | PixiTexture = null;\n public sprite: PixiSprite;\n constructor(image: HTMLImageElement | PixiTexture) {\n this._image = image;\n if (image) {\n if (image instanceof HTMLImageElement) {\n this.sprite = PixiSprite.from(image);\n } else if (image instanceof PixiTexture) {\n this.sprite = new PixiSprite(image);\n }\n } else {\n this.sprite = new PixiSprite();\n }\n }\n set image(val) {\n if (this._image === val) {\n return;\n }\n\n if (val instanceof HTMLImageElement) {\n this.sprite.texture && this.sprite.texture.destroy(false);\n this.sprite.texture = PixiTexture.from(val);\n } else if (val instanceof PixiTexture) {\n this.sprite.texture = val;\n }\n this._image = val;\n }\n get image() {\n return this._image;\n }\n}\n","import { AnimatedSprite, Texture } from 'pixi.js';\n\nexport default class SpriteAnimation {\n animatedSprite: AnimatedSprite;\n constructor({ frames }: { frames: Texture[] }) {\n this.animatedSprite = new AnimatedSprite(frames);\n }\n play() {\n this.animatedSprite.play();\n }\n stop() {\n this.animatedSprite.stop();\n }\n gotoAndPlay(frameNumber: number) {\n this.animatedSprite.gotoAndPlay(frameNumber);\n }\n gotoAndStop(frameNumber: number) {\n this.animatedSprite.gotoAndStop(frameNumber);\n }\n set speed(val: number) {\n this.animatedSprite.animationSpeed = val;\n }\n get speed() {\n return this.animatedSprite.animationSpeed;\n }\n}\n","import { Text as PixiText } from 'pixi.js';\nimport type { TextStyle } from 'pixi.js';\n\nexport default class Text extends PixiText {\n constructor(text: string, style?: Partial<TextStyle>) {\n super({ text, style });\n }\n}\n","import { Texture, TilingSprite as PixiTilingSprite } from 'pixi.js';\n\nexport default class TilingSprite {\n _image: HTMLImageElement | Texture | null = null;\n public tilingSprite: PixiTilingSprite;\n constructor(image: HTMLImageElement | Texture | null) {\n this._image = image;\n if (image instanceof HTMLImageElement) {\n this.tilingSprite = PixiTilingSprite.from(Texture.from(image));\n } else if (image instanceof Texture) {\n this.tilingSprite = PixiTilingSprite.from(image);\n } else {\n this.tilingSprite = PixiTilingSprite.from(Texture.EMPTY);\n }\n }\n set image(val: HTMLImageElement | Texture | null) {\n if (this._image === val) {\n return;\n }\n\n if (val instanceof HTMLImageElement) {\n this.tilingSprite.texture = Texture.from(val);\n } else if (val instanceof Texture) {\n this.tilingSprite.texture = val;\n }\n this._image = val;\n }\n get image() {\n return this._image;\n }\n}\n"],"names":["PixiContainer","PixiGraphics","PixiSprite","PixiTexture","PixiText","PixiTilingSprite"],"mappings":";;;AAEc,MAAO,SAAU,SAAQA,WAAa,CAAA;AAEnD;;ACHa,MAAO,QAAS,SAAQC,UAAY,CAAA;AAEjD;;ACDa,MAAO,SAAU,SAAQ,eAAe,CAAA;IACpD,WAAA,CACE,GAAqB,EACrB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,YAAoB,EAAA;AAEpB,QAAA,MAAM,OAAO,GAAG,OAAO,GAAG,KAAK,QAAQ,GAAG,OAAO,CAAC,IAAI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AAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAC1D;IACF;IACA,IAAI,KAAK,CAAC,GAAsC,EAAA;AAC9C,QAAA,IAAI,IAAI,CAAC,MAAM,KAAK,GAAG,EAAE;YACvB;QACF;AAEA,QAAA,IAAI,GAAG,YAAY,gBAAgB,EAAE;YACnC,IAAI,CAAC,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/C;AAAO,aAAA,IAAI,GAAG,YAAY,OAAO,EAAE;AACjC,YAAA,IAAI,CAAC,YAAY,CAAC,OAAO,GAAG,GAAG;QACjC;AACA,QAAA,IAAI,CAAC,MAAM,GAAG,GAAG;IACnB;AACA,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,MAAM;IACpB;AACD;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combos-fun/renderer-adapter",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Pixi v8 display-object adapter layer used by @combos-fun/plugin-renderer and its 2D rendering sub-plugins",
5
5
  "main": "index.js",
6
6
  "module": "dist/renderer-adapter.esm.js",