ofxSpriteSheetRenderer - check animation complete

Any way to check if a specific sprite in your renderer has completed an animation? See comment below:

void GameScreen::addWater()
{
    if (!WATER_FLOWING)
    {
        mainRenderer->addCenteredTile(&waterStartAnim, sink.pos.x, sink.pos.y,0,F_NONE,sink.drawScale,255,255,255,255);
        
        //if waterStartAnim is complete, set WATER_FLOWING to true
    }
    else
    {
         mainRenderer->addCenteredTile(&waterLoopAnim, sink.pos.x, sink.pos.y,0,F_NONE,sink.drawScale,255,255,255,255);
    }
}

Hmm, this was pretty easy after a little poking around in the renderer. Just made a pointer waterAnim and set it to the start anim, checked if it was on the last frame (which I also had overlap with the loop animation so it wouldn’t end up skipping part of a frame), and if it was, set it the boolean to true.

I moved the stuff around from above, but in my sink object’s update:

if (ACTIVE)
{
    if (!WATER_FLOWING)
    {
        // set equal to start up
        waterAnim = &waterStartAnim;
        
        // check if frame is equal to total - 1 (frame starts at 0, total counts from 1).
        if (waterAnim->frame == waterAnim->total_frames-1)
        {
            // if so, flip boolean, reset start anim to 0 but preemptively switch anims so we don't see that.
            WATER_FLOWING = true;
            waterAnim->frame = 0;
            waterAnim = &waterLoopAnim;
        }
    }
    else
    {
        waterAnim = &waterLoopAnim;
    }
}