GlPortal Class Reference  0.1.1
Source code documentation of the free and open 3D action puzzle game.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Screen.hpp
Go to the documentation of this file.
1 #ifndef COMPONENT_SCREEN_HPP
2 #define COMPONENT_SCREEN_HPP
3 
5 
6 #include <serine/Archiver.hpp>
7 
9 
10 namespace glPortal {
11 
12 class Screen : public radix::Component {
13 public:
14  std::string title;
15  std::string text;
16  bool enabled;
17  float alpha;
18  Vector4f backgroundColor;
19  Vector4f textColor;
20 
22  Component(ent),
23  enabled(false),
24  backgroundColor(0, 0, 0, 1),
25  textColor(1, 1, 1, 1) {
26  }
27 
28  const char* getName() const {
29  return "Screen";
30  }
31 
32  TypeId getTypeId() const {
33  return Component::getTypeId<std::remove_reference<decltype(*this)>::type>();
34  }
35 
36  void serialize(serine::Archiver &ar) {
37  ar("enabled", enabled);
38  ar("backgroundColor", backgroundColor);
39  ar("textColor", textColor);
40  }
41 };
42 
43 } /* namespace radix */
44 
45 #endif /* COMPONENT_SCREEN_HPP */
Vector4f backgroundColor
Definition: Screen.hpp:18
bool enabled
Definition: Screen.hpp:16
Component(const Component &)=delete
ECS entity, Component container It is created like this:
Definition: Entity.hpp:23
Definition: Screen.hpp:10
std::string title
Definition: Screen.hpp:14
const char * getName() const
Definition: Screen.hpp:28
Definition: Screen.hpp:12
Base class to create entity components.
Definition: Component.hpp:25
TypeId getTypeId() const
Definition: Screen.hpp:32
void serialize(serine::Archiver &ar)
Definition: Screen.hpp:36
ComponentTypeId TypeId
Definition: Component.hpp:35
float alpha
Definition: Screen.hpp:17
Screen(radix::Entity &ent)
Definition: Screen.hpp:21
std::string text
Definition: Screen.hpp:15
Vector4f textColor
Definition: Screen.hpp:19