Thanks a lot Trixt0r, that is a great advice. I think that solves also my problem of removing a listener from a Player right at the moment when the method animationFinished() of the listener is called. I always got an error when update() is called right after I removed the listener. Is that because of the Player still iterating through the Array while I remove the listener from it? But when I handle the events from the listener inside the extended PlayerTweener, I probably won't have that problem.
A little bit more examples or more explanations in the wiki would be good. Maybe also regarding the following questions:
Animation speed/time step
Am I supposed to control the speed of the Player by myself to achieve a constant speed on all devices? I haven't found something related to that in your code, only the dependence of the speed value. When I understand it correctly, on every update you proceed 15 ms in time. Why 15 ms? Wouldn't it be easier to control it by a float from 0 to 1?
Looping animations
I don't really understand from where the looping value in the Animation class comes from. I thought when I disable the "Repeat Playback" button on top of the timeline in Spriter, the animation is played only once, but it is still looping. Do I have to handle that with the animationFinished() method from the listener?
Changing bone parent
I'm not sure if it is a bug, but there is a strange positioning problem on bones that change parent. It's more or less like the situation in this Spriter video
.When a bone changes the parent bone (or is created) somewhere in the middle of the timeline, the attached image is positioned at (0, 0) and is not moving/rotating. Strange is that it works when you play it directly in player1 or when you set the animation on the same player. But when you play the animation in a second player and set the weight immediately to that player, it doesn't work correctly.
EDIT: I tested it again in a different setup. It happens always when the bone count isn't the same in different animations. You already wrote that in the wiki on git.
//create() player = new PlayerTweener(reader.getData().getEntity("boy")); player.getFirstPlayer().setAnimation("walk"); player.setWeight(0); //touchUp() //works player.getFirstPlayer().setAnimation("animationChangingBone"); //doesn't work player.getSecondPlayer().setAnimation("animationChangingBone"); player.setWeight(1);