No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

button.h 547B

1234567891011121314151617181920212223242526272829
  1. #ifndef BUTTON_H
  2. #define BUTTON_H
  3. #include "olcPixelGameEngine.h"
  4. #include "game_state.h"
  5. #include <string>
  6. namespace pabloader {
  7. class Debuggers;
  8. typedef void (*ButtonAction)();
  9. class Button {
  10. public:
  11. Button(Debuggers* game, int32_t x, int32_t y, int32_t w, int32_t h, std::string txt, GameState state);
  12. void Draw();
  13. bool Update();
  14. void SetText(std::string txt) { text = txt; }
  15. private:
  16. Debuggers* game;
  17. olc::vi2d pos;
  18. olc::vi2d size;
  19. std::string text;
  20. GameState state;
  21. bool hover = false;
  22. };
  23. }
  24. #endif