Game Development Reference
In-Depth Information
When the dialog first loads, it checks to see if it should function as a splash screen
or as a loading screen. Basically, the dialog checks to see if any jobs have been des-
ignated for loading; if there are no jobs, it will function as a splash screen. In splash
screen mode, the dialog will start the display timer that will run for the specified
interval and then close. In loading screen mode, the dialog will remain open until
all jobs have been processed.
The key down and mouse click events call the interrupt method that attempts to
close the splash screen dialog early. The ability to do this is determined by the
Interruptible property in the settings and launcher class.
A loading screen cannot be interrupted in our framework because all jobs must complete before
the application can be considered ready for use. Canceling the loading process has the potential to
make the application unstable.
The following code implements the functionality of the splash screen and loading
dialog form.
public partial class SplashDialog : Form
private ILoadingJob _currentJob = null;
private SplashScreen _splashScreen = null;
public string VersionText
VersionLabel.Text = String.Format(“Version: {0}”, value);
int offset = this.Width - VersionLabel.Bounds.Right;
Graphics graphics = VersionLabel.CreateGraphics();
Size size = (graphics.MeasureString(VersionLabel.Text,
int newX = this.Width - offset - size.Width;
VersionLabel.Bounds = new Rectangle(newX,
size.Height + 4);
Search Nedrilad ::

Custom Search