player_status_hud.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // SuperTux
  2. // Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
  3. // 2006 Matthias Braun <matze@braunis.de>
  4. // 2018 Ingo Ruhnke <grumbel@gmail.com>
  5. //
  6. // This program is free software: you can redistribute it and/or modify
  7. // it under the terms of the GNU General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // This program is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU General Public License
  17. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #ifndef HEADER_SUPERTUX_SUPERTUX_PLAYER_STATUS_HUD_HPP
  19. #define HEADER_SUPERTUX_SUPERTUX_PLAYER_STATUS_HUD_HPP
  20. #include "supertux/game_object.hpp"
  21. #include "video/color.hpp"
  22. #include "video/surface_ptr.hpp"
  23. class DrawingContext;
  24. class PlayerStatus;
  25. class PlayerStatusHUD : public GameObject
  26. {
  27. private:
  28. static Color text_color;
  29. public:
  30. PlayerStatusHUD(PlayerStatus& player_status);
  31. virtual void update(float dt_sec) override;
  32. virtual void draw(DrawingContext& context) override;
  33. virtual bool is_saveable() const override { return false; }
  34. virtual bool is_singleton() const override { return true; }
  35. void reset();
  36. private:
  37. PlayerStatus& m_player_status;
  38. int displayed_coins;
  39. int displayed_coins_frame;
  40. SurfacePtr coin_surface;
  41. SurfacePtr fire_surface;
  42. SurfacePtr ice_surface;
  43. private:
  44. PlayerStatusHUD(const PlayerStatusHUD&) = delete;
  45. PlayerStatusHUD& operator=(const PlayerStatusHUD&) = delete;
  46. };
  47. #endif
  48. /* EOF */