MenuMain.cpp 817 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include "MenuMain.h"
  2. #include "DiPoint.h"
  3. void MenuMain::initialize()
  4. {
  5. //Trees
  6. tree0.setFrame(5);
  7. tree0.setCenterX(640 /4);
  8. tree0.setBottom(480); //ground.getGroundLevel()
  9. tree1.setFrame(5);
  10. tree1.setCenterX(640 *5/6);
  11. tree1.setBottom (480);//ground.getGroundLevel());
  12. //Title
  13. title.setFrame(7);
  14. title.setCenterX(640/2);
  15. title.setCenterY(480/4);
  16. //Buttons
  17. buttonStart.setFrame(8);
  18. buttonStart.setCenterX(640 /3);
  19. buttonStart.setCenterY(480 *2/3);
  20. buttonExtra.setFrame(8);
  21. buttonExtra.setCenterX(640 *2/3);
  22. buttonExtra.setCenterY(480 *2/3);
  23. }
  24. int MenuMain::update()
  25. {
  26. return 0;
  27. }
  28. void MenuMain::draw(SDL_Surface *screen)
  29. {
  30. //Trees
  31. tree0.draw(screen);
  32. tree1.draw(screen);
  33. //UI
  34. title.draw(screen);
  35. buttonStart.draw(screen);
  36. buttonExtra.draw(screen);
  37. }