示例#1
0
 private void Transition(GameTime gameTime)
 {
     Animation.Scale = new Vector2(this.Dimensions.X, this.Dimensions.Y);
     fAnimation.Update(gameTime, ref Animation);
     if (Animation.Alpha == 1.0f && fAnimation.Timer.TotalSeconds == 1.0f)
     {
         screenStack.Push(newScreen);
         currentScreen.UnloadContent();
         currentScreen = newScreen;
         currentScreen.LoadContent(content, this.inputManager);
     }
     else if (Animation.Alpha == 0.0f)
     {
         transition = false;
         Animation.IsActive = false;
     }
     else if (Animation.Alpha < 1.0f && fAnimation.Increase == false)
     {
         currentScreen.Update(gameTime);
     }
 }
示例#2
0
 public void AddScreen(GameScreen screen, InputManager inputManager, float alpha)
 {
     transition = true;
     newScreen = screen;
     Animation.IsActive = true;
     fAnimation.ActivateValue = 1.0f;
     if (alpha != 1.0f)
     {
         fAnimation.Alpha = 1.0f - alpha;
     }
     else
     {
         fAnimation.Alpha = alpha;
     }
     fAnimation.Increase = true;
     this.inputManager = inputManager;
     //audio.Play(0);
 }
示例#3
0
        public void Initialize()
        {
            Animation = new Animation();
            ssAnimation = new SpriteSheetAnimation();
            fAnimation = new FadeAnimation();

            currentScreen = new SplashScreen();
            inputManager = new InputManager();
        }
示例#4
0
 public void AddScreen(GameScreen screen, InputManager inputManager)
 {
     transition = true;
     newScreen = screen;
     Animation.IsActive = true;
     Animation.Alpha = 0.0f;
     fAnimation.ActivateValue = 1.0f;
     fAnimation.Increase = true;
     this.inputManager = inputManager;
     //audio.FadeSong(0.0f, new TimeSpan(0, 0, 0, 0, 1200));
 }