/// <summary> /// Constructs a new screen manager component. /// </summary> /// <param name="game">Game Reference</param> /// <exception cref="InvalidOperationException">No graphics device service.</exception> public ScreenManager(Game game) : base(game) { // Load Content Manager and set component values this.ContentManager = new ContentManager(game.Services); this.ContentManager.RootDirectory = "Content"; this.UpdateOrder = 50; this.DrawOrder = 50; // Add the spriteFonts Component _spriteFonts = new FontCollector(this.Game); this.Game.Components.Add(_spriteFonts); // Add Exiting Handler #if SILVERLIGHT this.Game.Exiting += new EventHandler(GameExiting); #else this.Game.Exiting += new EventHandler <EventArgs>(GameExiting); #endif // Add as Service this.Game.Services.AddService(this.GetType(), this); }
/// <summary> /// Constructs a new screen manager component. /// </summary> /// <param name="game">Game Reference</param> /// <exception cref="InvalidOperationException">No graphics device service.</exception> public ScreenManager(Game game) : base(game) { // Load Content Manager and set component values this.ContentManager = new ContentManager(game.Services); this.ContentManager.RootDirectory = "Content"; this.UpdateOrder = 50; this.DrawOrder = 50; // Add the spriteFonts Component _spriteFonts = new FontCollector(this.Game); this.Game.Components.Add(_spriteFonts); // Add Exiting Handler #if SILVERLIGHT this.Game.Exiting += new EventHandler(GameExiting); #else this.Game.Exiting += new EventHandler<EventArgs>(GameExiting); #endif // Add as Service this.Game.Services.AddService(this.GetType(), this); }