Esempio n. 1
0
 public void Start()
 {
     currentscreen.UnloadContent();
     currentscreen = new MenuScreen();
     currentscreen.LoadContent();
     fade.SetScale(new Vector2(GameSettings.Instance.Dimensions.X, GameSettings.Instance.Dimensions.Y));
 }
Esempio n. 2
0
        public void LoadContent(ContentManager Content)
        {
            this.Content = new ContentManager(Content.ServiceProvider, "Content");
            currentscreen.LoadContent();

            if (fade == null)
            {
                fade = new Image("Images/black");
            }
            if (fadeEffect == null)
            {
                fadeEffect = new FadeEffect(2.0f, 0.0f);
            }
            fade.SourceRect = new Rectangle(0, 0, (int)Dimensions.X, (int)Dimensions.Y);
            fade.LoadContent(0, 0, true, 1.0f);
        }
Esempio n. 3
0
        public void TransitionScreen(GameTime gameTime)
        {
            if (IsTransitioning)
            {
                fade.Alpha = fadeEffect.Update(gameTime);
                if (fade.Alpha >= 1.0f)
                {
                    currentscreen.UnloadContent();
                    currentscreen = (Screen)Activator.CreateInstance(Type.GetType("Game_Test." + newscreen));
                    currentscreen.LoadContent();
                    HasChangedScreen = true;
                }

                if (HasChangedScreen && fade.Alpha <= 0.0f)
                {
                    IsTransitioning = false;
                }
                fade.Update(gameTime);
            }
        }
Esempio n. 4
0
 public void Start()
 {
     currentscreen.UnloadContent();
     currentscreen = new MenuScreen();
     currentscreen.LoadContent();
 }
Esempio n. 5
0
        public void TransitionScreen(GameTime gameTime)
        {
            if (IsTransitioning)
            {
                fade.Alpha = fadeEffect.Update(gameTime);
                if (fade.Alpha >= 1.0f)
                {
                    currentscreen.UnloadContent();
                    currentscreen = (Screen)Activator.CreateInstance(Type.GetType("Game_Test." + newscreen));
                    currentscreen.LoadContent();
                    HasChangedScreen = true;
                }

                if (HasChangedScreen && fade.Alpha <= 0.0f)
                    IsTransitioning = false;
                fade.Update(gameTime);
            }
        }
Esempio n. 6
0
 public void Start()
 {
     currentscreen.UnloadContent();
     currentscreen = new MenuScreen();
     currentscreen.LoadContent();
 }