Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
change_text_event.h
Go to the documentation of this file.
1 #ifndef CHANGE_TEXT_EVENT_H
2 #define CHANGE_TEXT_EVENT_H
3 #include <glm/glm.hpp>
4 #include "events/event.h"
5 #include "events/event_type.h"
6 //= SCRIPTABLE
7 //= SCRIPTABLE BASES Event
8 
9 namespace Graphics {
10  namespace UI {
14  class ChangeTextEvent : public Events::Event {
15  private:
16  std::string text;
17  public:
18  //= BEGIN SCRIPTABLE
19 
25  ChangeTextEvent(const std::string& text) : Event(Events::EventType::CHANGE_TEXT), text(text) {}
33  static std::shared_ptr<ChangeTextEvent> create(const std::string& text) { return std::make_shared<ChangeTextEvent>(text); }
39  std::string getText() const noexcept { return text; }
40  //= END SCRIPTABLE
41  };
42  }
43 }
44 
45 #endif
Class for event.
Definition: event.h:10
std::string getText() const noexcept
Gets the text.
Definition: change_text_event.h:39
Definition: event_type.h:33
ChangeTextEvent(const std::string &text)
ChangeTextEvent constructor.
Definition: change_text_event.h:25
EventType
Event type enum that is used when passing events.
Definition: event_type.h:12
Class for change text event.
Definition: change_text_event.h:14
Event(const EventType &type)
Event constructor.
Definition: event.h:21
static std::shared_ptr< ChangeTextEvent > create(const std::string &text)
ChangeTextEvent factory function.
Definition: change_text_event.h:33