public void fadeOut ( float time ) { if ( fadeOutActionRunning ) return ; fadeOutActionRunning = true ; final Touchable previousTouchable = getTouchable ( ) ; setTouchable ( Touchable . disabled ) ; Stage stage = getStage ( ) ; if ( stage != null && stage . getKeyboardFocus ( ) != null && stage . getKeyboardFocus ( ) . isDescendantOf ( this ) ) { FocusManager . resetFocus ( stage ) ; } addAction ( Actions . sequence ( Actions . fadeOut ( time , Interpolation . fade ) , new Action ( ) { @ Override public boolean act ( float delta ) { setTouchable ( previousTouchable ) ; remove ( ) ; getColor ( ) . a = 1f ; fadeOutActionRunning = false ; return true ; } } ) ) ; }
Fade outs this window when fade out animation is completed window is removed from Stage . Calling this for the second time won t have any effect if previous animation is still running .