Ejemplo n.º 1
0
        /// <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 FontCache(this.Game);
            this.Game.Components.Add(_spriteFonts);

            // Add Exiting Handler
            this.Game.Exiting += new EventHandler <EventArgs>(GameExiting);

            // Add as Service
            this.Game.Services.AddService(this.GetType(), this);
        }
Ejemplo n.º 2
0
        /// <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 FontCache(this.Game);
            this.Game.Components.Add(_spriteFonts);

            // Add Exiting Handler
            this.Game.Exiting += new EventHandler<EventArgs>(GameExiting);

            // Add as Service
            this.Game.Services.AddService(this.GetType(), this);
        }