Esempio n. 1
0
        //screen transition

        public ScreenManager()
        {
            Dimensions           = new Vector2(640, 480);
            currentScreen        = new splashScreen();
            xmlGameScreenManager = new xmlManger <gameScreen>
            {
                Type = currentScreen.Type
            };
            currentScreen = xmlGameScreenManager.Load("Load/splashScreen.xml");
        }
Esempio n. 2
0
 void Transition(GameTime gameTime)
 {
     if (IsTransitioning)
     {
         Image.Update(gameTime);
         if (Image.Alpha == 1.0f)
         {
             currentScreen.UnloadContent();
             currentScreen             = newScreen;
             xmlGameScreenManager.Type = currentScreen.Type;
             if (File.Exists(currentScreen.XmlPath))
             {
                 currentScreen = xmlGameScreenManager.Load(currentScreen.XmlPath);
             }
             currentScreen.LoadContent();
         }
         else if (Image.Alpha == 0.0f)
         {
             Image.IsActive  = false;
             IsTransitioning = false;
         }
     }
 }