[ts] Renamed MixDirection.in/out to mixIn/mixOut as it was crashing a JS compressor. Fixed log output. Added mobile support for additive animation blending. Input does not require a fully defined Listener interface anymore.

This commit is contained in:
badlogic 2019-04-24 15:05:07 +02:00
parent 0e8e0646e4
commit 03057c6073
31 changed files with 608 additions and 388 deletions

View File

@ -19,8 +19,8 @@ declare module spine {
add = 3,
}
enum MixDirection {
in = 0,
out = 1,
mixIn = 0,
mixOut = 1,
}
enum TimelineType {
rotate = 0,

View File

@ -67,8 +67,8 @@ var spine;
})(MixBlend = spine.MixBlend || (spine.MixBlend = {}));
var MixDirection;
(function (MixDirection) {
MixDirection[MixDirection["in"] = 0] = "in";
MixDirection[MixDirection["out"] = 1] = "out";
MixDirection[MixDirection["mixIn"] = 0] = "mixIn";
MixDirection[MixDirection["mixOut"] = 1] = "mixOut";
})(MixDirection = spine.MixDirection || (spine.MixDirection = {}));
var TimelineType;
(function (TimelineType) {
@ -356,7 +356,7 @@ var spine;
}
else {
var bx = 0, by = 0;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
switch (blend) {
case MixBlend.setup:
bx = bone.data.scaleX;
@ -652,7 +652,7 @@ var spine;
};
AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {
var slot = skeleton.slots[this.slotIndex];
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
var attachmentName_1 = slot.data.attachmentName;
slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));
return;
@ -929,7 +929,7 @@ var spine;
DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {
var drawOrder = skeleton.drawOrder;
var slots = skeleton.slots;
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);
return;
}
@ -995,7 +995,7 @@ var spine;
if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1008,7 +1008,7 @@ var spine;
}
else {
constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1022,7 +1022,7 @@ var spine;
var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1035,7 +1035,7 @@ var spine;
}
else {
constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1405,7 +1405,7 @@ var spine;
var timelines = current.animation.timelines;
if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) {
for (var ii = 0; ii < timelineCount; ii++)
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]);
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection.mixIn);
}
else {
var timelineMode = current.timelineMode;
@ -1421,7 +1421,7 @@ var spine;
}
else {
spine.Utils.webkit602BugfixHelper(mix, blend);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection.mixIn);
}
}
}
@ -1458,7 +1458,7 @@ var spine;
var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);
if (blend == spine.MixBlend.add) {
for (var i = 0; i < timelineCount; i++)
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out);
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.mixOut);
}
else {
var timelineMode = from.timelineMode;
@ -1470,7 +1470,7 @@ var spine;
from.totalAlpha = 0;
for (var i = 0; i < timelineCount; i++) {
var timeline = timelines[i];
var direction = spine.MixDirection.out;
var direction = spine.MixDirection.mixOut;
var timelineBlend = void 0;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
@ -1504,11 +1504,11 @@ var spine;
if (timelineBlend == spine.MixBlend.setup) {
if (timeline instanceof spine.AttachmentTimeline) {
if (attachments || (timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
else if (timeline instanceof spine.DrawOrderTimeline) {
if (drawOrder)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
}
timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);
@ -1526,7 +1526,7 @@ var spine;
if (firstFrame)
timelinesRotation[i] = 0;
if (alpha == 1) {
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]);
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection.mixIn);
return;
}
var rotateTimeline = timeline;
@ -7338,7 +7338,8 @@ var spine;
var y = ev.clientY - rect.top;
var listeners = _this.listeners;
for (var i = 0; i < listeners.length; i++) {
listeners[i].down(x, y);
if (listeners[i].down)
listeners[i].down(x, y);
}
_this.lastX = x;
_this.lastY = y;
@ -7355,10 +7356,12 @@ var spine;
var listeners = _this.listeners;
for (var i = 0; i < listeners.length; i++) {
if (_this.buttonDown) {
listeners[i].dragged(x, y);
if (listeners[i].dragged)
listeners[i].dragged(x, y);
}
else {
listeners[i].moved(x, y);
if (listeners[i].moved)
listeners[i].moved(x, y);
}
}
_this.lastX = x;
@ -7372,7 +7375,8 @@ var spine;
var y = ev.clientY - rect.top;
var listeners = _this.listeners;
for (var i = 0; i < listeners.length; i++) {
listeners[i].up(x, y);
if (listeners[i].up)
listeners[i].up(x, y);
}
_this.lastX = x;
_this.lastY = y;
@ -7401,9 +7405,9 @@ var spine;
}
var listeners = _this.listeners;
for (var i_16 = 0; i_16 < listeners.length; i_16++) {
listeners[i_16].down(_this.currTouch.x, _this.currTouch.y);
if (listeners[i_16].down)
listeners[i_16].down(_this.currTouch.x, _this.currTouch.y);
}
console.log("Start " + _this.currTouch.x + ", " + _this.currTouch.y);
_this.lastX = _this.currTouch.x;
_this.lastY = _this.currTouch.y;
_this.buttonDown = true;
@ -7420,9 +7424,9 @@ var spine;
_this.touchesPool.free(_this.currTouch);
var listeners = _this.listeners;
for (var i_17 = 0; i_17 < listeners.length; i_17++) {
listeners[i_17].up(x, y);
if (listeners[i_17].up)
listeners[i_17].up(x, y);
}
console.log("End " + x + ", " + y);
_this.lastX = x;
_this.lastY = y;
_this.buttonDown = false;
@ -7443,9 +7447,9 @@ var spine;
_this.touchesPool.free(_this.currTouch);
var listeners = _this.listeners;
for (var i_18 = 0; i_18 < listeners.length; i_18++) {
listeners[i_18].up(x, y);
if (listeners[i_18].up)
listeners[i_18].up(x, y);
}
console.log("End " + x + ", " + y);
_this.lastX = x;
_this.lastY = y;
_this.buttonDown = false;
@ -7467,9 +7471,9 @@ var spine;
var y = touch.clientY - rect.top;
var listeners = _this.listeners;
for (var i_19 = 0; i_19 < listeners.length; i_19++) {
listeners[i_19].dragged(x, y);
if (listeners[i_19].dragged)
listeners[i_19].dragged(x, y);
}
console.log("Drag " + x + ", " + y);
_this.lastX = _this.currTouch.x = x;
_this.lastY = _this.currTouch.y = y;
break;

File diff suppressed because one or more lines are too long

View File

@ -19,8 +19,8 @@ declare module spine {
add = 3,
}
enum MixDirection {
in = 0,
out = 1,
mixIn = 0,
mixOut = 1,
}
enum TimelineType {
rotate = 0,

View File

@ -67,8 +67,8 @@ var spine;
})(MixBlend = spine.MixBlend || (spine.MixBlend = {}));
var MixDirection;
(function (MixDirection) {
MixDirection[MixDirection["in"] = 0] = "in";
MixDirection[MixDirection["out"] = 1] = "out";
MixDirection[MixDirection["mixIn"] = 0] = "mixIn";
MixDirection[MixDirection["mixOut"] = 1] = "mixOut";
})(MixDirection = spine.MixDirection || (spine.MixDirection = {}));
var TimelineType;
(function (TimelineType) {
@ -356,7 +356,7 @@ var spine;
}
else {
var bx = 0, by = 0;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
switch (blend) {
case MixBlend.setup:
bx = bone.data.scaleX;
@ -652,7 +652,7 @@ var spine;
};
AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {
var slot = skeleton.slots[this.slotIndex];
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
var attachmentName_1 = slot.data.attachmentName;
slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));
return;
@ -929,7 +929,7 @@ var spine;
DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {
var drawOrder = skeleton.drawOrder;
var slots = skeleton.slots;
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);
return;
}
@ -995,7 +995,7 @@ var spine;
if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1008,7 +1008,7 @@ var spine;
}
else {
constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1022,7 +1022,7 @@ var spine;
var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1035,7 +1035,7 @@ var spine;
}
else {
constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1405,7 +1405,7 @@ var spine;
var timelines = current.animation.timelines;
if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) {
for (var ii = 0; ii < timelineCount; ii++)
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]);
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection.mixIn);
}
else {
var timelineMode = current.timelineMode;
@ -1421,7 +1421,7 @@ var spine;
}
else {
spine.Utils.webkit602BugfixHelper(mix, blend);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection.mixIn);
}
}
}
@ -1458,7 +1458,7 @@ var spine;
var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);
if (blend == spine.MixBlend.add) {
for (var i = 0; i < timelineCount; i++)
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out);
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.mixOut);
}
else {
var timelineMode = from.timelineMode;
@ -1470,7 +1470,7 @@ var spine;
from.totalAlpha = 0;
for (var i = 0; i < timelineCount; i++) {
var timeline = timelines[i];
var direction = spine.MixDirection.out;
var direction = spine.MixDirection.mixOut;
var timelineBlend = void 0;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
@ -1504,11 +1504,11 @@ var spine;
if (timelineBlend == spine.MixBlend.setup) {
if (timeline instanceof spine.AttachmentTimeline) {
if (attachments || (timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
else if (timeline instanceof spine.DrawOrderTimeline) {
if (drawOrder)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
}
timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);
@ -1526,7 +1526,7 @@ var spine;
if (firstFrame)
timelinesRotation[i] = 0;
if (alpha == 1) {
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]);
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection.mixIn);
return;
}
var rotateTimeline = timeline;

File diff suppressed because one or more lines are too long

View File

@ -19,8 +19,8 @@ declare module spine {
add = 3,
}
enum MixDirection {
in = 0,
out = 1,
mixIn = 0,
mixOut = 1,
}
enum TimelineType {
rotate = 0,

View File

@ -67,8 +67,8 @@ var spine;
})(MixBlend = spine.MixBlend || (spine.MixBlend = {}));
var MixDirection;
(function (MixDirection) {
MixDirection[MixDirection["in"] = 0] = "in";
MixDirection[MixDirection["out"] = 1] = "out";
MixDirection[MixDirection["mixIn"] = 0] = "mixIn";
MixDirection[MixDirection["mixOut"] = 1] = "mixOut";
})(MixDirection = spine.MixDirection || (spine.MixDirection = {}));
var TimelineType;
(function (TimelineType) {
@ -356,7 +356,7 @@ var spine;
}
else {
var bx = 0, by = 0;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
switch (blend) {
case MixBlend.setup:
bx = bone.data.scaleX;
@ -652,7 +652,7 @@ var spine;
};
AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {
var slot = skeleton.slots[this.slotIndex];
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
var attachmentName_1 = slot.data.attachmentName;
slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));
return;
@ -929,7 +929,7 @@ var spine;
DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {
var drawOrder = skeleton.drawOrder;
var slots = skeleton.slots;
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);
return;
}
@ -995,7 +995,7 @@ var spine;
if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1008,7 +1008,7 @@ var spine;
}
else {
constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1022,7 +1022,7 @@ var spine;
var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1035,7 +1035,7 @@ var spine;
}
else {
constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1405,7 +1405,7 @@ var spine;
var timelines = current.animation.timelines;
if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) {
for (var ii = 0; ii < timelineCount; ii++)
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]);
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection.mixIn);
}
else {
var timelineMode = current.timelineMode;
@ -1421,7 +1421,7 @@ var spine;
}
else {
spine.Utils.webkit602BugfixHelper(mix, blend);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection.mixIn);
}
}
}
@ -1458,7 +1458,7 @@ var spine;
var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);
if (blend == spine.MixBlend.add) {
for (var i = 0; i < timelineCount; i++)
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out);
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.mixOut);
}
else {
var timelineMode = from.timelineMode;
@ -1470,7 +1470,7 @@ var spine;
from.totalAlpha = 0;
for (var i = 0; i < timelineCount; i++) {
var timeline = timelines[i];
var direction = spine.MixDirection.out;
var direction = spine.MixDirection.mixOut;
var timelineBlend = void 0;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
@ -1504,11 +1504,11 @@ var spine;
if (timelineBlend == spine.MixBlend.setup) {
if (timeline instanceof spine.AttachmentTimeline) {
if (attachments || (timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
else if (timeline instanceof spine.DrawOrderTimeline) {
if (drawOrder)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
}
timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);
@ -1526,7 +1526,7 @@ var spine;
if (firstFrame)
timelinesRotation[i] = 0;
if (alpha == 1) {
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]);
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection.mixIn);
return;
}
var rotateTimeline = timeline;

File diff suppressed because one or more lines are too long

View File

@ -19,8 +19,8 @@ declare module spine {
add = 3,
}
enum MixDirection {
in = 0,
out = 1,
mixIn = 0,
mixOut = 1,
}
enum TimelineType {
rotate = 0,

View File

@ -67,8 +67,8 @@ var spine;
})(MixBlend = spine.MixBlend || (spine.MixBlend = {}));
var MixDirection;
(function (MixDirection) {
MixDirection[MixDirection["in"] = 0] = "in";
MixDirection[MixDirection["out"] = 1] = "out";
MixDirection[MixDirection["mixIn"] = 0] = "mixIn";
MixDirection[MixDirection["mixOut"] = 1] = "mixOut";
})(MixDirection = spine.MixDirection || (spine.MixDirection = {}));
var TimelineType;
(function (TimelineType) {
@ -356,7 +356,7 @@ var spine;
}
else {
var bx = 0, by = 0;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
switch (blend) {
case MixBlend.setup:
bx = bone.data.scaleX;
@ -652,7 +652,7 @@ var spine;
};
AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {
var slot = skeleton.slots[this.slotIndex];
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
var attachmentName_1 = slot.data.attachmentName;
slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));
return;
@ -929,7 +929,7 @@ var spine;
DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {
var drawOrder = skeleton.drawOrder;
var slots = skeleton.slots;
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);
return;
}
@ -995,7 +995,7 @@ var spine;
if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1008,7 +1008,7 @@ var spine;
}
else {
constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1022,7 +1022,7 @@ var spine;
var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1035,7 +1035,7 @@ var spine;
}
else {
constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1405,7 +1405,7 @@ var spine;
var timelines = current.animation.timelines;
if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) {
for (var ii = 0; ii < timelineCount; ii++)
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]);
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection.mixIn);
}
else {
var timelineMode = current.timelineMode;
@ -1421,7 +1421,7 @@ var spine;
}
else {
spine.Utils.webkit602BugfixHelper(mix, blend);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection.mixIn);
}
}
}
@ -1458,7 +1458,7 @@ var spine;
var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);
if (blend == spine.MixBlend.add) {
for (var i = 0; i < timelineCount; i++)
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out);
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.mixOut);
}
else {
var timelineMode = from.timelineMode;
@ -1470,7 +1470,7 @@ var spine;
from.totalAlpha = 0;
for (var i = 0; i < timelineCount; i++) {
var timeline = timelines[i];
var direction = spine.MixDirection.out;
var direction = spine.MixDirection.mixOut;
var timelineBlend = void 0;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
@ -1504,11 +1504,11 @@ var spine;
if (timelineBlend == spine.MixBlend.setup) {
if (timeline instanceof spine.AttachmentTimeline) {
if (attachments || (timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
else if (timeline instanceof spine.DrawOrderTimeline) {
if (drawOrder)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
}
timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);
@ -1526,7 +1526,7 @@ var spine;
if (firstFrame)
timelinesRotation[i] = 0;
if (alpha == 1) {
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]);
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection.mixIn);
return;
}
var rotateTimeline = timeline;
@ -7072,7 +7072,8 @@ var spine;
var y = ev.clientY - rect.top;
var listeners = _this.listeners;
for (var i = 0; i < listeners.length; i++) {
listeners[i].down(x, y);
if (listeners[i].down)
listeners[i].down(x, y);
}
_this.lastX = x;
_this.lastY = y;
@ -7089,10 +7090,12 @@ var spine;
var listeners = _this.listeners;
for (var i = 0; i < listeners.length; i++) {
if (_this.buttonDown) {
listeners[i].dragged(x, y);
if (listeners[i].dragged)
listeners[i].dragged(x, y);
}
else {
listeners[i].moved(x, y);
if (listeners[i].moved)
listeners[i].moved(x, y);
}
}
_this.lastX = x;
@ -7106,7 +7109,8 @@ var spine;
var y = ev.clientY - rect.top;
var listeners = _this.listeners;
for (var i = 0; i < listeners.length; i++) {
listeners[i].up(x, y);
if (listeners[i].up)
listeners[i].up(x, y);
}
_this.lastX = x;
_this.lastY = y;
@ -7135,9 +7139,9 @@ var spine;
}
var listeners = _this.listeners;
for (var i_16 = 0; i_16 < listeners.length; i_16++) {
listeners[i_16].down(_this.currTouch.x, _this.currTouch.y);
if (listeners[i_16].down)
listeners[i_16].down(_this.currTouch.x, _this.currTouch.y);
}
console.log("Start " + _this.currTouch.x + ", " + _this.currTouch.y);
_this.lastX = _this.currTouch.x;
_this.lastY = _this.currTouch.y;
_this.buttonDown = true;
@ -7154,9 +7158,9 @@ var spine;
_this.touchesPool.free(_this.currTouch);
var listeners = _this.listeners;
for (var i_17 = 0; i_17 < listeners.length; i_17++) {
listeners[i_17].up(x, y);
if (listeners[i_17].up)
listeners[i_17].up(x, y);
}
console.log("End " + x + ", " + y);
_this.lastX = x;
_this.lastY = y;
_this.buttonDown = false;
@ -7177,9 +7181,9 @@ var spine;
_this.touchesPool.free(_this.currTouch);
var listeners = _this.listeners;
for (var i_18 = 0; i_18 < listeners.length; i_18++) {
listeners[i_18].up(x, y);
if (listeners[i_18].up)
listeners[i_18].up(x, y);
}
console.log("End " + x + ", " + y);
_this.lastX = x;
_this.lastY = y;
_this.buttonDown = false;
@ -7201,9 +7205,9 @@ var spine;
var y = touch.clientY - rect.top;
var listeners = _this.listeners;
for (var i_19 = 0; i_19 < listeners.length; i_19++) {
listeners[i_19].dragged(x, y);
if (listeners[i_19].dragged)
listeners[i_19].dragged(x, y);
}
console.log("Drag " + x + ", " + y);
_this.lastX = _this.currTouch.x = x;
_this.lastY = _this.currTouch.y = y;
break;

File diff suppressed because one or more lines are too long

View File

@ -19,8 +19,8 @@ declare module spine {
add = 3,
}
enum MixDirection {
in = 0,
out = 1,
mixIn = 0,
mixOut = 1,
}
enum TimelineType {
rotate = 0,

View File

@ -67,8 +67,8 @@ var spine;
})(MixBlend = spine.MixBlend || (spine.MixBlend = {}));
var MixDirection;
(function (MixDirection) {
MixDirection[MixDirection["in"] = 0] = "in";
MixDirection[MixDirection["out"] = 1] = "out";
MixDirection[MixDirection["mixIn"] = 0] = "mixIn";
MixDirection[MixDirection["mixOut"] = 1] = "mixOut";
})(MixDirection = spine.MixDirection || (spine.MixDirection = {}));
var TimelineType;
(function (TimelineType) {
@ -356,7 +356,7 @@ var spine;
}
else {
var bx = 0, by = 0;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
switch (blend) {
case MixBlend.setup:
bx = bone.data.scaleX;
@ -652,7 +652,7 @@ var spine;
};
AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {
var slot = skeleton.slots[this.slotIndex];
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
var attachmentName_1 = slot.data.attachmentName;
slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));
return;
@ -929,7 +929,7 @@ var spine;
DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {
var drawOrder = skeleton.drawOrder;
var slots = skeleton.slots;
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);
return;
}
@ -995,7 +995,7 @@ var spine;
if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1008,7 +1008,7 @@ var spine;
}
else {
constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1022,7 +1022,7 @@ var spine;
var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1035,7 +1035,7 @@ var spine;
}
else {
constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1405,7 +1405,7 @@ var spine;
var timelines = current.animation.timelines;
if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) {
for (var ii = 0; ii < timelineCount; ii++)
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]);
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection.mixIn);
}
else {
var timelineMode = current.timelineMode;
@ -1421,7 +1421,7 @@ var spine;
}
else {
spine.Utils.webkit602BugfixHelper(mix, blend);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection.mixIn);
}
}
}
@ -1458,7 +1458,7 @@ var spine;
var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);
if (blend == spine.MixBlend.add) {
for (var i = 0; i < timelineCount; i++)
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out);
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.mixOut);
}
else {
var timelineMode = from.timelineMode;
@ -1470,7 +1470,7 @@ var spine;
from.totalAlpha = 0;
for (var i = 0; i < timelineCount; i++) {
var timeline = timelines[i];
var direction = spine.MixDirection.out;
var direction = spine.MixDirection.mixOut;
var timelineBlend = void 0;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
@ -1504,11 +1504,11 @@ var spine;
if (timelineBlend == spine.MixBlend.setup) {
if (timeline instanceof spine.AttachmentTimeline) {
if (attachments || (timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
else if (timeline instanceof spine.DrawOrderTimeline) {
if (drawOrder)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
}
timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);
@ -1526,7 +1526,7 @@ var spine;
if (firstFrame)
timelinesRotation[i] = 0;
if (alpha == 1) {
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]);
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection.mixIn);
return;
}
var rotateTimeline = timeline;

File diff suppressed because one or more lines are too long

View File

@ -19,8 +19,8 @@ declare module spine {
add = 3,
}
enum MixDirection {
in = 0,
out = 1,
mixIn = 0,
mixOut = 1,
}
enum TimelineType {
rotate = 0,

View File

@ -67,8 +67,8 @@ var spine;
})(MixBlend = spine.MixBlend || (spine.MixBlend = {}));
var MixDirection;
(function (MixDirection) {
MixDirection[MixDirection["in"] = 0] = "in";
MixDirection[MixDirection["out"] = 1] = "out";
MixDirection[MixDirection["mixIn"] = 0] = "mixIn";
MixDirection[MixDirection["mixOut"] = 1] = "mixOut";
})(MixDirection = spine.MixDirection || (spine.MixDirection = {}));
var TimelineType;
(function (TimelineType) {
@ -356,7 +356,7 @@ var spine;
}
else {
var bx = 0, by = 0;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
switch (blend) {
case MixBlend.setup:
bx = bone.data.scaleX;
@ -652,7 +652,7 @@ var spine;
};
AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {
var slot = skeleton.slots[this.slotIndex];
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
var attachmentName_1 = slot.data.attachmentName;
slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));
return;
@ -929,7 +929,7 @@ var spine;
DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {
var drawOrder = skeleton.drawOrder;
var slots = skeleton.slots;
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);
return;
}
@ -995,7 +995,7 @@ var spine;
if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1008,7 +1008,7 @@ var spine;
}
else {
constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1022,7 +1022,7 @@ var spine;
var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1035,7 +1035,7 @@ var spine;
}
else {
constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;
if (direction == MixDirection["in"]) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1405,7 +1405,7 @@ var spine;
var timelines = current.animation.timelines;
if ((i == 0 && mix == 1) || blend == spine.MixBlend.add) {
for (var ii = 0; ii < timelineCount; ii++)
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection["in"]);
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection.mixIn);
}
else {
var timelineMode = current.timelineMode;
@ -1421,7 +1421,7 @@ var spine;
}
else {
spine.Utils.webkit602BugfixHelper(mix, blend);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection["in"]);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection.mixIn);
}
}
}
@ -1458,7 +1458,7 @@ var spine;
var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);
if (blend == spine.MixBlend.add) {
for (var i = 0; i < timelineCount; i++)
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.out);
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.mixOut);
}
else {
var timelineMode = from.timelineMode;
@ -1470,7 +1470,7 @@ var spine;
from.totalAlpha = 0;
for (var i = 0; i < timelineCount; i++) {
var timeline = timelines[i];
var direction = spine.MixDirection.out;
var direction = spine.MixDirection.mixOut;
var timelineBlend = void 0;
var alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
@ -1504,11 +1504,11 @@ var spine;
if (timelineBlend == spine.MixBlend.setup) {
if (timeline instanceof spine.AttachmentTimeline) {
if (attachments || (timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
else if (timeline instanceof spine.DrawOrderTimeline) {
if (drawOrder)
direction = spine.MixDirection["in"];
direction = spine.MixDirection.mixIn;
}
}
timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);
@ -1526,7 +1526,7 @@ var spine;
if (firstFrame)
timelinesRotation[i] = 0;
if (alpha == 1) {
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection["in"]);
timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection.mixIn);
return;
}
var rotateTimeline = timeline;
@ -7072,7 +7072,8 @@ var spine;
var y = ev.clientY - rect.top;
var listeners = _this.listeners;
for (var i = 0; i < listeners.length; i++) {
listeners[i].down(x, y);
if (listeners[i].down)
listeners[i].down(x, y);
}
_this.lastX = x;
_this.lastY = y;
@ -7089,10 +7090,12 @@ var spine;
var listeners = _this.listeners;
for (var i = 0; i < listeners.length; i++) {
if (_this.buttonDown) {
listeners[i].dragged(x, y);
if (listeners[i].dragged)
listeners[i].dragged(x, y);
}
else {
listeners[i].moved(x, y);
if (listeners[i].moved)
listeners[i].moved(x, y);
}
}
_this.lastX = x;
@ -7106,7 +7109,8 @@ var spine;
var y = ev.clientY - rect.top;
var listeners = _this.listeners;
for (var i = 0; i < listeners.length; i++) {
listeners[i].up(x, y);
if (listeners[i].up)
listeners[i].up(x, y);
}
_this.lastX = x;
_this.lastY = y;
@ -7135,9 +7139,9 @@ var spine;
}
var listeners = _this.listeners;
for (var i_16 = 0; i_16 < listeners.length; i_16++) {
listeners[i_16].down(_this.currTouch.x, _this.currTouch.y);
if (listeners[i_16].down)
listeners[i_16].down(_this.currTouch.x, _this.currTouch.y);
}
console.log("Start " + _this.currTouch.x + ", " + _this.currTouch.y);
_this.lastX = _this.currTouch.x;
_this.lastY = _this.currTouch.y;
_this.buttonDown = true;
@ -7154,9 +7158,9 @@ var spine;
_this.touchesPool.free(_this.currTouch);
var listeners = _this.listeners;
for (var i_17 = 0; i_17 < listeners.length; i_17++) {
listeners[i_17].up(x, y);
if (listeners[i_17].up)
listeners[i_17].up(x, y);
}
console.log("End " + x + ", " + y);
_this.lastX = x;
_this.lastY = y;
_this.buttonDown = false;
@ -7177,9 +7181,9 @@ var spine;
_this.touchesPool.free(_this.currTouch);
var listeners = _this.listeners;
for (var i_18 = 0; i_18 < listeners.length; i_18++) {
listeners[i_18].up(x, y);
if (listeners[i_18].up)
listeners[i_18].up(x, y);
}
console.log("End " + x + ", " + y);
_this.lastX = x;
_this.lastY = y;
_this.buttonDown = false;
@ -7201,9 +7205,9 @@ var spine;
var y = touch.clientY - rect.top;
var listeners = _this.listeners;
for (var i_19 = 0; i_19 < listeners.length; i_19++) {
listeners[i_19].dragged(x, y);
if (listeners[i_19].dragged)
listeners[i_19].dragged(x, y);
}
console.log("Drag " + x + ", " + y);
_this.lastX = _this.currTouch.x = x;
_this.lastY = _this.currTouch.y = y;
break;

File diff suppressed because one or more lines are too long

View File

@ -90,7 +90,7 @@ module spine {
}
export enum MixDirection {
in, out
mixIn, mixOut
}
export enum TimelineType {
@ -397,7 +397,7 @@ module spine {
}
} else {
let bx = 0, by = 0;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
switch (blend) {
case MixBlend.setup:
bx = bone.data.scaleX;
@ -701,7 +701,7 @@ module spine {
apply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {
let slot = skeleton.slots[this.slotIndex];
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
let attachmentName = slot.data.attachmentName;
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));
return;
@ -1009,7 +1009,7 @@ module spine {
apply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {
let drawOrder: Array<Slot> = skeleton.drawOrder;
let slots: Array<Slot> = skeleton.slots;
if (direction == MixDirection.out && blend == MixBlend.setup) {
if (direction == MixDirection.mixOut && blend == MixBlend.setup) {
Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);
return;
}
@ -1086,7 +1086,7 @@ module spine {
if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { // Time is after last frame.
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1097,7 +1097,7 @@ module spine {
}
} else {
constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;
if (direction == MixDirection.in) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;
@ -1115,7 +1115,7 @@ module spine {
if (blend == MixBlend.setup) {
constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;
if (direction == MixDirection.out) {
if (direction == MixDirection.mixOut) {
constraint.bendDirection = constraint.data.bendDirection;
constraint.compress = constraint.data.compress;
constraint.stretch = constraint.data.stretch;
@ -1126,7 +1126,7 @@ module spine {
}
} else {
constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;
if (direction == MixDirection.in) {
if (direction == MixDirection.mixIn) {
constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];
constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;
constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;

View File

@ -162,7 +162,7 @@ module spine {
let timelines = current.animation.timelines;
if ((i == 0 && mix == 1) || blend == MixBlend.add) {
for (let ii = 0; ii < timelineCount; ii++)
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, MixDirection.in);
timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, MixDirection.mixIn);
} else {
let timelineMode = current.timelineMode;
@ -178,7 +178,7 @@ module spine {
} else {
// This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109
Utils.webkit602BugfixHelper(mix, blend);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, MixDirection.in);
timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, MixDirection.mixIn);
}
}
}
@ -214,7 +214,7 @@ module spine {
let alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);
if (blend == MixBlend.add) {
for (let i = 0; i < timelineCount; i++)
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, MixDirection.out);
timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, MixDirection.mixOut);
} else {
let timelineMode = from.timelineMode;
let timelineHoldMix = from.timelineHoldMix;
@ -226,7 +226,7 @@ module spine {
from.totalAlpha = 0;
for (let i = 0; i < timelineCount; i++) {
let timeline = timelines[i];
let direction = MixDirection.out;
let direction = MixDirection.mixOut;
let timelineBlend: MixBlend;
let alpha = 0;
switch (timelineMode[i] & (AnimationState.NOT_LAST - 1)) {
@ -258,9 +258,9 @@ module spine {
Utils.webkit602BugfixHelper(alpha, blend);
if (timelineBlend == MixBlend.setup) {
if (timeline instanceof AttachmentTimeline) {
if (attachments || (timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST) direction = MixDirection.in;
if (attachments || (timelineMode[i] & AnimationState.NOT_LAST) == AnimationState.NOT_LAST) direction = MixDirection.mixIn;
} else if (timeline instanceof DrawOrderTimeline) {
if (drawOrder) direction = MixDirection.in;
if (drawOrder) direction = MixDirection.mixIn;
}
}
timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);
@ -282,7 +282,7 @@ module spine {
if (firstFrame) timelinesRotation[i] = 0;
if (alpha == 1) {
timeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.in);
timeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.mixIn);
return;
}

0
spine-ts/webgl/demos/assets/atlas1.atlas Executable file → Normal file
View File

BIN
spine-ts/webgl/demos/assets/atlas1.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

607
spine-ts/webgl/demos/assets/atlas2.atlas Executable file → Normal file

File diff suppressed because it is too large Load Diff

BIN
spine-ts/webgl/demos/assets/atlas2.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

2
spine-ts/webgl/demos/assets/demos.json Executable file → Normal file

File diff suppressed because one or more lines are too long

0
spine-ts/webgl/demos/assets/heroes.atlas Executable file → Normal file
View File

BIN
spine-ts/webgl/demos/assets/heroes.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 KiB

After

Width:  |  Height:  |  Size: 908 KiB

View File

@ -18,6 +18,7 @@
<script src="stretchyman.js"></script>
<script src="tank.js"></script>
<script src="transforms.js"></script>
<script src="additiveblending.js"></script>
<script src="demos.js"></script>
</head>
@ -331,5 +332,22 @@
</div>
</div>
</div>
<div class="demo" id="demo-additive-blending">
<div>
<div>
<h2 id="Additive-blending"><a href="#Additive-blending">Additive Blending</a></h2>
<div class="demo-container">
<div class="aspect"></div>
<div class="resize"></div>
</div>
<div class="demo-text">
<div class="controls">
<div class="control" style="padding-bottom:6px">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body></html>

View File

@ -20,6 +20,7 @@ $(function () {
stretchymanDemo,
tankDemo,
transformsDemo,
additiveBlendingDemo
];
var placeholders = document.getElementsByClassName("aspect");

View File

@ -122,7 +122,7 @@ var spritesheetsDemo = function(canvas, bgColor) {
walkLastTimePrecise += delta;
while (walkLastTimePrecise - walkLastTime > 1 / FPS) {
var newWalkTime = walkLastTime + 1 / FPS;
walkAnim.apply(skeletonSeq, walkLastTime, newWalkTime, true, null, 1, spine.MixBlend.setup, spine.MixDirection.in);
walkAnim.apply(skeletonSeq, walkLastTime, newWalkTime, true, null, 1, spine.MixBlend.setup, spine.MixDirection.mixIn);
walkLastTime = newWalkTime;
}
skeletonSeq.updateWorldTransform();

View File

@ -54,7 +54,7 @@ module spine.webgl {
let listeners = this.listeners;
for (let i = 0; i < listeners.length; i++) {
listeners[i].down(x, y);
if (listeners[i].down) listeners[i].down(x, y);
}
this.lastX = x;
@ -75,9 +75,9 @@ module spine.webgl {
let listeners = this.listeners;
for (let i = 0; i < listeners.length; i++) {
if (this.buttonDown) {
listeners[i].dragged(x, y);
if (listeners[i].dragged) listeners[i].dragged(x, y);
} else {
listeners[i].moved(x, y);
if (listeners[i].moved) listeners[i].moved(x, y);
}
}
@ -94,7 +94,7 @@ module spine.webgl {
let listeners = this.listeners;
for (let i = 0; i < listeners.length; i++) {
listeners[i].up(x, y);
if (listeners[i].up) listeners[i].up(x, y);
}
this.lastX = x;
@ -128,9 +128,9 @@ module spine.webgl {
let listeners = this.listeners;
for (let i = 0; i < listeners.length; i++) {
listeners[i].down(this.currTouch.x, this.currTouch.y);
if (listeners[i].down) listeners[i].down(this.currTouch.x, this.currTouch.y);
}
console.log("Start " + this.currTouch.x + ", " + this.currTouch.y);
this.lastX = this.currTouch.x;
this.lastY = this.currTouch.y;
this.buttonDown = true;
@ -147,9 +147,9 @@ module spine.webgl {
this.touchesPool.free(this.currTouch);
let listeners = this.listeners;
for (let i = 0; i < listeners.length; i++) {
listeners[i].up(x, y);
if (listeners[i].up) listeners[i].up(x, y);
}
console.log("End " + x + ", " + y);
this.lastX = x;
this.lastY = y;
this.buttonDown = false;
@ -170,9 +170,9 @@ module spine.webgl {
this.touchesPool.free(this.currTouch);
let listeners = this.listeners;
for (let i = 0; i < listeners.length; i++) {
listeners[i].up(x, y);
if (listeners[i].up) listeners[i].up(x, y);
}
console.log("End " + x + ", " + y);
this.lastX = x;
this.lastY = y;
this.buttonDown = false;
@ -195,9 +195,9 @@ module spine.webgl {
let listeners = this.listeners;
for (let i = 0; i < listeners.length; i++) {
listeners[i].dragged(x, y);
if (listeners[i].dragged) listeners[i].dragged(x, y);
}
console.log("Drag " + x + ", " + y);
this.lastX = this.currTouch.x = x;
this.lastY = this.currTouch.y = y;
break;