Пример #1
0
        public void AddScreen(GameScreen screen)
        {
            screen.ScreenManager = this;
            screen.Width = Game.Window.ClientBounds.Width;
            screen.Height = Game.Window.ClientBounds.Height;

            if (isInitialized)
            {
                screen.SpriteBatch = SpriteBatch;
                screen.Font = Font;
                screen.LoadContent();
            }

            screens.Add(screen);
        }
Пример #2
0
        public void RemoveScreen(GameScreen screen)
        {
            if (screen.ScreenManager == this)
                screen.ScreenManager = null;

            if (screens.Contains(screen))
                screens.Remove(screen);
        }