[ts][player] Closes #1279, expose setAnimation().

This commit is contained in:
badlogic 2019-02-14 11:43:17 +01:00
parent c0277ff12b
commit c9e760a025
7 changed files with 8 additions and 8 deletions

View File

@ -1876,7 +1876,7 @@ declare module spine {
setupInput(): void; setupInput(): void;
private play(); private play();
private pause(); private pause();
private setAnimation(animation); setAnimation(animation: string): void;
private percentageToWorldUnit(size, percentageOrAbsolute); private percentageToWorldUnit(size, percentageOrAbsolute);
private calculateAnimationViewport(animationName); private calculateAnimationViewport(animationName);
} }

View File

@ -10987,7 +10987,7 @@ var spine;
this.viewportTransitionStart = performance.now(); this.viewportTransitionStart = performance.now();
this.animationState.clearTracks(); this.animationState.clearTracks();
this.skeleton.setToSetupPose(); this.skeleton.setToSetupPose();
this.animationState.setAnimation(0, this.config.animation, true); this.animationState.setAnimation(0, animation, true);
}; };
SpinePlayer.prototype.percentageToWorldUnit = function (size, percentageOrAbsolute) { SpinePlayer.prototype.percentageToWorldUnit = function (size, percentageOrAbsolute) {
if (typeof percentageOrAbsolute === "string") { if (typeof percentageOrAbsolute === "string") {

File diff suppressed because one or more lines are too long

View File

@ -1786,7 +1786,7 @@ declare module spine {
setupInput(): void; setupInput(): void;
private play(); private play();
private pause(); private pause();
private setAnimation(animation); setAnimation(animation: string): void;
private percentageToWorldUnit(size, percentageOrAbsolute); private percentageToWorldUnit(size, percentageOrAbsolute);
private calculateAnimationViewport(animationName); private calculateAnimationViewport(animationName);
} }

View File

@ -10324,7 +10324,7 @@ var spine;
this.viewportTransitionStart = performance.now(); this.viewportTransitionStart = performance.now();
this.animationState.clearTracks(); this.animationState.clearTracks();
this.skeleton.setToSetupPose(); this.skeleton.setToSetupPose();
this.animationState.setAnimation(0, this.config.animation, true); this.animationState.setAnimation(0, animation, true);
}; };
SpinePlayer.prototype.percentageToWorldUnit = function (size, percentageOrAbsolute) { SpinePlayer.prototype.percentageToWorldUnit = function (size, percentageOrAbsolute) {
if (typeof percentageOrAbsolute === "string") { if (typeof percentageOrAbsolute === "string") {

File diff suppressed because one or more lines are too long

View File

@ -1099,7 +1099,7 @@
this.playButton.classList.add("spine-player-button-icon-play"); this.playButton.classList.add("spine-player-button-icon-play");
} }
private setAnimation (animation: string) { public setAnimation (animation: string) {
// Determine viewport // Determine viewport
this.previousViewport = this.currentViewport; this.previousViewport = this.currentViewport;
let animViewport = this.calculateAnimationViewport(animation); let animViewport = this.calculateAnimationViewport(animation);
@ -1156,7 +1156,7 @@
this.animationState.clearTracks(); this.animationState.clearTracks();
this.skeleton.setToSetupPose(); this.skeleton.setToSetupPose();
this.animationState.setAnimation(0, this.config.animation, true); this.animationState.setAnimation(0, animation, true);
} }
private percentageToWorldUnit(size: number, percentageOrAbsolute: string | number): number { private percentageToWorldUnit(size: number, percentageOrAbsolute: string | number): number {