No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

80 líneas
2.6 KiB

  1. /**********************************************************************************************
  2. *
  3. * raylib - Standard Game template
  4. *
  5. * Logo Screen Functions Definitions (Init, Update, Draw, Unload)
  6. *
  7. * Copyright (c) 2014-2020 Ramon Santamaria (@raysan5)
  8. *
  9. * This software is provided "as-is", without any express or implied warranty. In no event
  10. * will the authors be held liable for any damages arising from the use of this software.
  11. *
  12. * Permission is granted to anyone to use this software for any purpose, including commercial
  13. * applications, and to alter it and redistribute it freely, subject to the following restrictions:
  14. *
  15. * 1. The origin of this software must not be misrepresented; you must not claim that you
  16. * wrote the original software. If you use this software in a product, an acknowledgment
  17. * in the product documentation would be appreciated but is not required.
  18. *
  19. * 2. Altered source versions must be plainly marked as such, and must not be misrepresented
  20. * as being the original software.
  21. *
  22. * 3. This notice may not be removed or altered from any source distribution.
  23. *
  24. **********************************************************************************************/
  25. #include "raylib.h"
  26. #include "screens.h"
  27. //----------------------------------------------------------------------------------
  28. // Global Variables Definition (local to this module)
  29. //----------------------------------------------------------------------------------
  30. // Logo screen global variables
  31. static int framesCounter;
  32. static int finishScreen;
  33. //----------------------------------------------------------------------------------
  34. // Logo Screen Functions Definition
  35. //----------------------------------------------------------------------------------
  36. // Logo Screen Initialization logic
  37. void InitLogoScreen(void)
  38. {
  39. // TODO: Initialize LOGO screen variables here!
  40. framesCounter = 0;
  41. finishScreen = 0;
  42. }
  43. // Logo Screen Update logic
  44. void UpdateLogoScreen(void)
  45. {
  46. // TODO: Update LOGO screen variables here!
  47. framesCounter++; // Count frames
  48. // Wait for 2 seconds (120 frames) before jumping to TITLE screen
  49. if (framesCounter > 120)
  50. {
  51. finishScreen = true;
  52. }
  53. }
  54. // Logo Screen Draw logic
  55. void DrawLogoScreen(void)
  56. {
  57. // TODO: Draw LOGO screen here!
  58. DrawText("LOGO SCREEN", 20, 20, 40, LIGHTGRAY);
  59. DrawText("WAIT for 2 SECONDS...", 290, 220, 20, GRAY);
  60. }
  61. // Logo Screen Unload logic
  62. void UnloadLogoScreen(void)
  63. {
  64. // TODO: Unload LOGO screen variables here!
  65. }
  66. // Logo Screen should finish?
  67. int FinishLogoScreen(void)
  68. {
  69. return finishScreen;
  70. }