pixi-spine
Advanced tools
Comparing version 1.5.6 to 1.5.7
@@ -1260,4 +1260,8 @@ /// <reference types="pixi.js" /> | ||
hackTextureBySlotIndex(slotIndex: number, texture?: PIXI.Texture, size?: PIXI.Rectangle): boolean; | ||
hackTextureBySlotName: (slotName: string, texture?: PIXI.Texture, size?: PIXI.Rectangle) => any; | ||
hackTextureBySlotName(slotName: string, texture?: PIXI.Texture, size?: PIXI.Rectangle): boolean; | ||
newContainer(): PIXI.Container; | ||
newSprite(tex: PIXI.Texture): SpineSprite; | ||
newGraphics(): PIXI.Graphics; | ||
newMesh(texture: PIXI.Texture, vertices?: Float32Array, uvs?: Float32Array, indices?: Uint16Array, drawMode?: number): SpineMesh; | ||
} | ||
} |
{ | ||
"name": "pixi-spine", | ||
"version": "1.5.6", | ||
"version": "1.5.7", | ||
"description": "Spine implementation for pixi v^3 and v^4", | ||
@@ -5,0 +5,0 @@ "author": "Mat Groves", |
@@ -102,3 +102,3 @@ /// <reference types="pixi.js" /> | ||
let attachment: any = slot.attachment; | ||
let slotContainer = new PIXI.Container(); | ||
let slotContainer = this.newContainer(); | ||
this.slotContainers.push(slotContainer); | ||
@@ -375,3 +375,3 @@ this.addChild(slotContainer); | ||
if (!c) { | ||
c = this.tempClipContainers[i] = new PIXI.Container(); | ||
c = this.tempClipContainers[i] = this.newContainer(); | ||
c.visible = false; | ||
@@ -458,3 +458,3 @@ } | ||
let texture = region.texture; | ||
let sprite = new SpineSprite(texture); | ||
let sprite = this.newSprite(texture); | ||
sprite.rotation = attachment.rotation * core.MathUtils.degRad; | ||
@@ -488,3 +488,3 @@ sprite.anchor.x = 0.5; | ||
} | ||
let strip = new SpineMesh( | ||
let strip = this.newMesh( | ||
region.texture, | ||
@@ -511,3 +511,3 @@ new Float32Array(attachment.regionUVs.length), | ||
createGraphics(slot: core.Slot, clip: core.ClippingAttachment) { | ||
let graphics = new PIXI.Graphics(); | ||
let graphics = this.newGraphics(); | ||
let poly = new PIXI.Polygon([]); | ||
@@ -519,3 +519,3 @@ graphics.clear(); | ||
slot.currentGraphics = graphics; | ||
slot.clippingContainer = new PIXI.Container(); | ||
slot.clippingContainer = this.newContainer(); | ||
slot.clippingContainer.mask = slot.currentGraphics; | ||
@@ -579,3 +579,3 @@ | ||
*/ | ||
hackTextureBySlotName = function (slotName: string, texture: PIXI.Texture = null, size: PIXI.Rectangle = null) { | ||
hackTextureBySlotName(slotName: string, texture: PIXI.Texture = null, size: PIXI.Rectangle = null) { | ||
let index = this.skeleton.findSlotIndex(slotName); | ||
@@ -587,2 +587,19 @@ if (index == -1) { | ||
} | ||
//those methods can be overriden to spawn different classes | ||
newContainer() { | ||
return new PIXI.Container(); | ||
} | ||
newSprite(tex: PIXI.Texture) { | ||
return new SpineSprite(tex); | ||
} | ||
newGraphics() { | ||
return new PIXI.Graphics(); | ||
} | ||
newMesh(texture: PIXI.Texture, vertices?: Float32Array, uvs?: Float32Array, indices?: Uint16Array, drawMode?: number) { | ||
return new SpineMesh(texture, vertices, uvs, indices, drawMode); | ||
} | ||
} | ||
@@ -589,0 +606,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1558482
16413