TextLabel.h 934 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * 2D Game Engine
  3. * TextLabel.h:
  4. * Based on pikuma.com 2D game engine in C++ and Lua course
  5. * Copyright (c) 2021 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 27/02/2021.
  8. */
  9. #ifndef GAMEENGINE_SOURCE_INCLUDE_COMPONENTS_TEXTLABEL_H
  10. #define GAMEENGINE_SOURCE_INCLUDE_COMPONENTS_TEXTLABEL_H
  11. #include <SDL.h>
  12. #include <glm/glm.hpp>
  13. #include <string>
  14. struct TextLabelComponent
  15. {
  16. glm::vec2 position;
  17. std::string text;
  18. std::string fontId;
  19. SDL_Color fgColor;
  20. bool isFixed;
  21. TextLabelComponent(glm::vec2 position = glm::vec2(0, 0),
  22. std::string text = "",
  23. std::string fontId = "",
  24. SDL_Color fgColor = {0, 0, 0, 0},
  25. bool isFixed = true) : position(position), text(text), fontId(fontId), fgColor(fgColor), isFixed(isFixed) {};
  26. };
  27. #endif /* GAMEENGINE_SOURCE_INCLUDE_COMPONENTS_TEXTLABEL_H */