private void Reload(KeyPress keypress) { limbo_State = Limbo_State.fade_In; screen_Fade = content.Load<Texture2D>("Fades/White"); Limbo_Font = content.Load<SpriteFont>("Fonts/Limbo_Font"); AlphaValue = 0f; FadeDelay = 0; sub_KeyPress = keypress; text_Page = 0; Update_Text(keypress); reload = false; }
public Window_Return_Info Update(GameTime gameTime, KeyPress keyPress) { Window_Return_Info window_Return_Info; window_Return_Info.windowTransition = false; window_Return_Info.newState = Game_Window_State.Game_Mode_State; Base_Components.Camera.offset = Vector2.Zero; if (reload == true) { Reload(keyPress); } if (keyPress.key_Esc == 1) { limbo_State = Limbo_State.fade_Out; screen_Fade = content.Load<Texture2D>("Fades/Black"); text_Page = 420; } Update_Text(keyPress); switch (limbo_State) { case Limbo_State.fade_In: FadeDelay -= gameTime.ElapsedGameTime.TotalSeconds; if (FadeDelay <= 0) { FadeDelay = fade_Delay; AlphaValue += fadeIncrement; if (AlphaValue >= 1) { AlphaValue = MathHelper.Clamp(AlphaValue, 0, 1); limbo_State = Limbo_State.text; screen_Fade = content.Load<Texture2D>("Fades/Black"); } } break; case Limbo_State.text: if (keyPress.key_Space == 1) { limbo_State = Limbo_State.fade_Out; } break; case Limbo_State.fade_Out: FadeDelay -= gameTime.ElapsedGameTime.TotalSeconds; if (FadeDelay <= 0) { FadeDelay = fade_Delay; AlphaValue -= fadeIncrement; if (AlphaValue <= 0) { AlphaValue = MathHelper.Clamp(AlphaValue, 0, 1); if (text_Page >= 5) { limbo_State = Limbo_State.change_state; } else { limbo_State = Limbo_State.fade_In; text_Page += 1; } } } break; case Limbo_State.change_state: Dismiss(); window_Return_Info.windowTransition = true; window_Return_Info.newState = Game_Window_State.Game_Mode_State; break; } return window_Return_Info; }