crossFadeFrom method
Causes this action to fadeIn, fading out another action simultaneously, within the passed time interval. This method can be chained.
If warpBoolean is true, additional warping (gradually changes
of the time scales) will be applied.
Note: Like with fadeIn/fadeOut, the fading starts/ends with a weight
of 1.
Implementation
AnimationAction crossFadeFrom(AnimationAction fadeOutAction, num duration, [bool warp = false]) {
fadeOutAction.fadeOut(duration);
fadeIn(duration);
if (warp) {
final fadeInDuration = clip.duration,
fadeOutDuration = fadeOutAction.clip.duration,
startEndRatio = fadeOutDuration / fadeInDuration,
endStartRatio = fadeInDuration / fadeOutDuration;
fadeOutAction.warp(1.0, startEndRatio, duration);
this.warp(endStartRatio, 1.0, duration);
}
return this;
}