You can set multiple animations on different tracks with a little bit of JavaScript. Something like this will do:
<script>
new spine.SpinePlayer("player-container", {
jsonUrl: "http://purplemind.me/spine_files/fisherman.json",
atlasUrl: "http://purplemind.me/spine_files/fisherman.atlas",
showControls: false,
alpha: true,
backgroundColor: "#00000000",
viewport: {
debugRender: false,
x: 0,
y: 0,
width: 1210,
height: 1210,
padLeft: "0%",
padRight: "0%",
padTop: "0%",
padBottom: "0%"
}, success: function (player) {
player.animationState.setAnimation(0, "run", true);
player.animationState.setAnimation(1, "shoot", true);
}
});
</script>
This sets a piece of JavaScript code that is called when the player has successfully loaded all assets. You can then tell the player to queue up animations on different tracks. The first number in the setAnimation
line is the track index. Next you specify the animation name. Finally, you can say true
if you want the animation to loop, and false
for it to only play once.