Skip to content

Commit

Permalink
Fixed #1059 for spine-ts.
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Jan 10, 2018
1 parent 82d3dd8 commit c3e1f9b
Show file tree
Hide file tree
Showing 15 changed files with 2,124 additions and 1,340 deletions.
48 changes: 25 additions & 23 deletions spine-ts/build/spine-all.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ declare module spine {
timelines: Array<Timeline>;
duration: number;
constructor(name: string, timelines: Array<Timeline>, duration: number);
apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
static binarySearch(values: ArrayLike<number>, target: number, step?: number): number;
static linearSearch(values: ArrayLike<number>, target: number, step: number): number;
}
interface Timeline {
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
getPropertyId(): number;
}
enum MixPose {
enum MixBlend {
setup = 0,
current = 1,
currentLayered = 2,
first = 1,
replace = 2,
add = 3,
}
enum MixDirection {
in = 0,
Expand Down Expand Up @@ -52,7 +53,7 @@ declare module spine {
getCurveType(frameIndex: number): number;
setCurve(frameIndex: number, cx1: number, cy1: number, cx2: number, cy2: number): void;
getCurvePercent(frameIndex: number, percent: number): number;
abstract apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
abstract apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class RotateTimeline extends CurveTimeline {
static ENTRIES: number;
Expand All @@ -64,7 +65,7 @@ declare module spine {
constructor(frameCount: number);
getPropertyId(): number;
setFrame(frameIndex: number, time: number, degrees: number): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class TranslateTimeline extends CurveTimeline {
static ENTRIES: number;
Expand All @@ -78,17 +79,17 @@ declare module spine {
constructor(frameCount: number);
getPropertyId(): number;
setFrame(frameIndex: number, time: number, x: number, y: number): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class ScaleTimeline extends TranslateTimeline {
constructor(frameCount: number);
getPropertyId(): number;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class ShearTimeline extends TranslateTimeline {
constructor(frameCount: number);
getPropertyId(): number;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class ColorTimeline extends CurveTimeline {
static ENTRIES: number;
Expand All @@ -106,7 +107,7 @@ declare module spine {
constructor(frameCount: number);
getPropertyId(): number;
setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class TwoColorTimeline extends CurveTimeline {
static ENTRIES: number;
Expand All @@ -130,7 +131,7 @@ declare module spine {
constructor(frameCount: number);
getPropertyId(): number;
setFrame(frameIndex: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class AttachmentTimeline implements Timeline {
slotIndex: number;
Expand All @@ -140,7 +141,7 @@ declare module spine {
getPropertyId(): number;
getFrameCount(): number;
setFrame(frameIndex: number, time: number, attachmentName: string): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class DeformTimeline extends CurveTimeline {
slotIndex: number;
Expand All @@ -150,7 +151,7 @@ declare module spine {
constructor(frameCount: number);
getPropertyId(): number;
setFrame(frameIndex: number, time: number, vertices: ArrayLike<number>): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class EventTimeline implements Timeline {
frames: ArrayLike<number>;
Expand All @@ -159,7 +160,7 @@ declare module spine {
getPropertyId(): number;
getFrameCount(): number;
setFrame(frameIndex: number, event: Event): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class DrawOrderTimeline implements Timeline {
frames: ArrayLike<number>;
Expand All @@ -168,7 +169,7 @@ declare module spine {
getPropertyId(): number;
getFrameCount(): number;
setFrame(frameIndex: number, time: number, drawOrder: Array<number>): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class IkConstraintTimeline extends CurveTimeline {
static ENTRIES: number;
Expand All @@ -182,7 +183,7 @@ declare module spine {
constructor(frameCount: number);
getPropertyId(): number;
setFrame(frameIndex: number, time: number, mix: number, bendDirection: number): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class TransformConstraintTimeline extends CurveTimeline {
static ENTRIES: number;
Expand All @@ -200,7 +201,7 @@ declare module spine {
constructor(frameCount: number);
getPropertyId(): number;
setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number, scaleMix: number, shearMix: number): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class PathConstraintPositionTimeline extends CurveTimeline {
static ENTRIES: number;
Expand All @@ -212,12 +213,12 @@ declare module spine {
constructor(frameCount: number);
getPropertyId(): number;
setFrame(frameIndex: number, time: number, value: number): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class PathConstraintSpacingTimeline extends PathConstraintPositionTimeline {
constructor(frameCount: number);
getPropertyId(): number;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
class PathConstraintMixTimeline extends CurveTimeline {
static ENTRIES: number;
Expand All @@ -231,7 +232,7 @@ declare module spine {
constructor(frameCount: number);
getPropertyId(): number;
setFrame(frameIndex: number, time: number, rotateMix: number, translateMix: number): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, pose: MixPose, direction: MixDirection): void;
apply(skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection): void;
}
}
declare module spine {
Expand All @@ -255,8 +256,8 @@ declare module spine {
update(delta: number): void;
updateMixingFrom(to: TrackEntry, delta: number): boolean;
apply(skeleton: Skeleton): boolean;
applyMixingFrom(to: TrackEntry, skeleton: Skeleton, currentPose: MixPose): number;
applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, pose: MixPose, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
applyMixingFrom(to: TrackEntry, skeleton: Skeleton, blend: MixBlend): number;
applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, blend: MixBlend, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
queueEvents(entry: TrackEntry, animationTime: number): void;
clearTracks(): void;
clearTrack(trackIndex: number): void;
Expand Down Expand Up @@ -303,6 +304,7 @@ declare module spine {
mixDuration: number;
interruptAlpha: number;
totalAlpha: number;
mixBlend: MixBlend;
timelineData: number[];
timelineDipMix: TrackEntry[];
timelinesRotation: number[];
Expand Down
Loading

0 comments on commit c3e1f9b

Please sign in to comment.