sry for the late reply...
the fix is not what I had in mind.. now isStopped() is returning false always if animation is set to ping pong
normally animation is considered stopped when it has reached it's target frame, from 0 to n where n is last frame. If set to pingpong, target frame becomes 0 but only when in negative direction (going backwards)
EDIT:
remove last fix:
Code:
public boolean isStopped() {
return stopped;
}
and add new one:
Animation:558,
Code:
private void nextFrame(long delta) {...
while (nextChange < 0 && (!stopped)) {
if (currentFrame == stopAt) {
stopped = true;
break;
}
if (!loop && (!pingPong && currentFrame == frames.size() - 1)) { // THIS CHANGED
stopped = true;
break;
}
currentFrame = (currentFrame + direction) % frames.size();
if (pingPong) {
if (currentFrame <= 0) {
currentFrame = 0;
direction = 1;
if (!loop) { // THIS CHANGED
stopped = true; // THIS CHANGED
break; // THIS CHANGED
} // THIS CHANGED
}
else if (currentFrame >= frames.size()-1) {
currentFrame = frames.size()-1;
direction = -1;
}
}
int realDuration = (int) (((Frame) frames.get(currentFrame)).duration / speed);
nextChange = nextChange + realDuration;
}
it's a bit ugly.. but I couldn't do it without major refactoring in mind...