Exemple #1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            MusicManager.Update();

            GameMouse.Update(gameTime);
            Camera.Update(gameTime);

            foreach (BaseScreen screen in ScreensToAdd)
            {
                Screens.Add(screen);
            }

            ScreensToAdd.Clear();

            foreach (BaseScreen screen in Screens)
            {
                // Update before handling input - otherwise if we select something the WhileSelected method will be called straightaway, which is usually undesired
                if (screen.Active)
                {
                    screen.Update(gameTime);
                }
            }

            foreach (BaseScreen screen in ScreensToRemove)
            {
                Screens.Remove(screen);
            }

            ScreensToRemove.Clear();
        }
Exemple #2
0
        public void Begin()
        {
            foreach (BaseScreen baseScreen in ScreensToAdd)
            {
                Screens.Add(baseScreen);
            }

            ScreensToAdd.Clear();
        }