SplashScreen.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //-----------------------------------------------------------------------------
  2. // SplashScreen.cs
  3. //
  4. // Microsoft XNA Community Game Platform
  5. // Copyright (C) Microsoft Corporation. All rights reserved.
  6. //-----------------------------------------------------------------------------
  7. using Microsoft.Xna.Framework;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Text;
  11. using RacingGame.Graphics;
  12. using RacingGame.GameLogic;
  13. using RacingGame.Shaders;
  14. namespace RacingGame.GameScreens
  15. {
  16. /// <summary>
  17. /// Splash screen
  18. /// </summary>
  19. class SplashScreen : IGameScreen
  20. {
  21. /// <summary>
  22. /// Unimplemented
  23. /// </summary>
  24. /// <param name="gameTime"></param>
  25. public void Update(GameTime gameTime)
  26. {
  27. }
  28. /// <summary>
  29. /// Render splash screen
  30. /// </summary>
  31. public bool Render()
  32. {
  33. BaseGame.UI.UpdateCarInMenu();
  34. ShadowMapShader.PrepareGameShadows();
  35. // Render background and black bar
  36. BaseGame.UI.RenderGameBackground();
  37. BaseGame.UI.RenderMenuTrackBackground();
  38. BaseGame.UI.RenderBlackBar(518, 61);
  39. // Show shadows we calculated above
  40. if (BaseGame.AllowShadowMapping)
  41. ShaderEffect.shadowMapping.ShowShadows();
  42. // Show Press Start to continue.
  43. if ((int)(BaseGame.TotalTime / 0.375f) % 3 != 0)
  44. BaseGame.UI.Headers.RenderOnScreen(
  45. BaseGame.CalcRectangleCenteredWithGivenHeight(
  46. 512, 518 + 61 / 2, 26, UIRenderer.PressStartGfxRect),
  47. UIRenderer.PressStartGfxRect);
  48. // Clicking or pressing start will go to the menu
  49. return Input.MouseLeftButtonJustPressed ||
  50. Input.KeyboardSpaceJustPressed ||
  51. Input.KeyboardEscapeJustPressed ||
  52. Input.GamePadStartPressed;
  53. }
  54. }
  55. }