public void Start() { currentscreen.UnloadContent(); currentscreen = new MenuScreen(); currentscreen.LoadContent(); fade.SetScale(new Vector2(GameSettings.Instance.Dimensions.X, GameSettings.Instance.Dimensions.Y)); }
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); }
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); } }
public void Start() { currentscreen.UnloadContent(); currentscreen = new MenuScreen(); currentscreen.LoadContent(); }
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); } }
public void Start() { currentscreen.UnloadContent(); currentscreen = new MenuScreen(); currentscreen.LoadContent(); }