Game Development Reference
In-Depth Information
if (_splashScreen.Fading)
FadeOutTimer.Start();
else
this.Close();
}
Lastly, another timer is used to fade out the window visibility and then close the
window when it becomes hidden. The following code implements the fade out
timer event.
private void FadeOutTimer_Tick(object sender, System.EventArgs e)
{
if (this.Opacity > 0.01)
this.Opacity -= 0.1;
else
{
FadeOutTimer.Stop();
this.Close();
}
}
The load event for the dialog must also be updated to support the new fading
effect. The following code implements the updated dialog load event.
private void SplashDialog_Load(object sender, EventArgs e)
{
if (_splashScreen.Fading)
FadeInTimer.Start();
else
{
this.Opacity = 1.0;
if (_splashScreen.LoadingJobs == null ||
_splashScreen.LoadingJobs.Count <= 0)
DisplayTimer.Start();
else
ProcessJobs();
}
}
The splash interrupt method must also be updated to cancel the active timers and
start the fade out timer, if appropriate. The following code implements the updated
splash interrupt method.
Search Nedrilad ::




Custom Search