Hi,
these are very specific questions. It would probably help if you learn a bit more about the Timeline
. For instance, instead of using apply
, you could use appendTo
to schedule a new animation that follows the first. For example, you could fade in and then out again using:
const float kDuration = 1.0f;
timeline().apply( &mAlpha, 1.0f, kDuration );
timeline().appendTo( &mAlpha, 0.0f, kDuration );
You can also specify a delay, so that we wait 5 seconds before fading out. Replace the second line with:
timeline().appendTo( &mAlpha, 0.0f, kDuration ).delay( 5.0f );
You can also add a callback function, which will be called once we’re done fading:
timeline().appendTo( &mAlpha, 0.0f, kDuration ).delay( 5.0f ).finishFn( [&]() {
// Do something in this lambda function. Example: just quit.
quit();
} );
Hopefully with these additional tools under your belt you will be able to animate what you need.
-Paul