diff --git a/src/pixi/extras/Spine.js b/src/pixi/extras/Spine.js index 38db1ad..1e5da15 100644 --- a/src/pixi/extras/Spine.js +++ b/src/pixi/extras/Spine.js @@ -411,9 +411,9 @@ spine.ColorTimeline.prototype = { slotIndex: 0, getFrameCount: function () { - return this.frames.length / 2; + return this.frames.length / 5; }, - setFrame: function (frameIndex, time, x, y) { + setFrame: function (frameIndex, time, r, g, b, a) { frameIndex *= 5; this.frames[frameIndex] = time; this.frames[frameIndex + 1] = r; @@ -1111,7 +1111,7 @@ }; spine.SkeletonJson.toColor = function (hexString, colorIndex) { if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString; - return parseInt(hexString.substring(colorIndex * 2, 2), 16) / 255; + return parseInt(hexString.substr(colorIndex * 2, 2), 16) / 255; }; spine.Atlas = function (atlasText, textureLoader) { @@ -1452,6 +1452,9 @@ slotContainer.scale.y = bone.worldScaleY; slotContainer.rotation = -(slot.bone.worldRotation * Math.PI / 180); + + slotContainer.alpha = slot.a; + slot.currentSprite.tint = PIXI.rgb2hex([slot.r,slot.g,slot.b]); } PIXI.DisplayObjectContainer.prototype.updateTransform.call(this);