src/main/java/com/tajnyprojekt/tpanimation/TpAnimation.java
private void updatePlayback() {
        // check if finished
        if (elapsedMillis >= durationMillis) {
            loopCount++;
            loopEndCallback();
            if (isLooping) {
                elapsedMillis = 0;
                if (isMirroring) {
                    isForwardPlayback = !isForwardPlayback;
                }
                if (loopsToDo != 0 && loopCount >= loopsToDo) {
                    finish();
                }
            }
            else {
                finish();
            }
        }

        // update progress
        updateTimer();

        if (isForwardPlayback) {
            progress = PApplet.map(elapsedMillis, 0, durationMillis, 0.0f, 1.0f);
        }
        else {
            progress = PApplet.map(elapsedMillis, 0, durationMillis, 1.0f, 0.0f);
        }
    }
/**
     * Updates the state and progress of playback when <b>not rendering</b> frames in time based manner.
     */
Updates the state and progress of playback when not rendering frames in time based manner.
Updates the state and progress of playback when not rendering frames in time based manner .
private void updatePlayback() {
        if (elapsedMillis >= durationMillis) {
            loopCount++;
            loopEndCallback();
            if (isLooping) {
                elapsedMillis = 0;
                if (isMirroring) {
                    isForwardPlayback = !isForwardPlayback;
                }
                if (loopsToDo != 0 && loopCount >= loopsToDo) {
                    finish();
                }
            }
            else {
                finish();
            }
        }
        updateTimer();
        if (isForwardPlayback) {
            progress = PApplet.map(elapsedMillis, 0, durationMillis, 0.0f, 1.0f);
        }
        else {
            progress = PApplet.map(elapsedMillis, 0, durationMillis, 1.0f, 0.0f);
        }
    }
private void updatePlayback ( ) { if ( elapsedMillis >= durationMillis ) { loopCount ++ ; loopEndCallback ( ) ; if ( isLooping ) { elapsedMillis = 0 ; if ( isMirroring ) { isForwardPlayback = ! isForwardPlayback ; } if ( loopsToDo != 0 && loopCount >= loopsToDo ) { finish ( ) ; } } else { finish ( ) ; } } updateTimer ( ) ; if ( isForwardPlayback ) { progress = PApplet . map ( elapsedMillis , 0 , durationMillis , 0.0f , 1.0f ) ; } else { progress = PApplet . map ( elapsedMillis , 0 , durationMillis , 1.0f , 0.0f ) ; } }
Updates the state and progress of playback when <b>not rendering</b> frames in time based manner.
Updates the state and progress of playback when <b > not rendering< / b > frames in time based manner .
// check if finished // update progress