20 std::shared_ptr<WrappableText> text;
21 const glm::vec4 mouse_over_dim = glm::vec4(0.2, 0.2, 0.2, 0.0);
32 TextArea(std::shared_ptr<WrappableText> text,
VertexData vertex_data, std::shared_ptr<Skin> skin,
const unsigned int layer);
50 static std::shared_ptr<TextArea>
create(std::shared_ptr<Skin> skin, std::shared_ptr<WrappableText> text, glm::vec4 color, glm::vec4 text_color,
float padding,
float screen_width,
float screen_height,
float x_pos,
float y_pos,
float width,
float height,
const unsigned int layer);
57 void setText(std::shared_ptr<WrappableText> text);
63 std::shared_ptr<WrappableText>
getText()
const noexcept;
70 virtual void onKeyDown(
const int key)
override;
71 virtual void onKeyUp(
const int key)
override;
73 virtual void onScroll(
const glm::dvec2 position_change)
override;
75 virtual void onStart()
override;
76 virtual bool onUpdate(
const double delta)
override;
82 virtual std::string
to_string()
const noexcept
override;
83 virtual std::string
className()
const noexcept
override;
87 void onNotifyNow(std::shared_ptr<Events::Event> event)
override;
90 virtual void log(el::base::type::ostream_t& os)
const;
virtual bool onUpdate(const double delta) override
Called every engine loop.
Definition: text_area.cpp:47
virtual std::string className() const noexceptoverride
Returns a string representing the class name.
Definition: text_area.cpp:99
TextArea(std::shared_ptr< WrappableText > text, VertexData vertex_data, std::shared_ptr< Skin > skin, const unsigned int layer)
TextArea constructor.
Definition: text_area.cpp:8
virtual void onLeftClickRelease() override
Called when element has left click released over it.
Definition: text_area.cpp:73
virtual void onKeyRepeat(const int key) override
Called when a key is repeated while element is in focus.
Definition: text_area.cpp:93
virtual std::string to_string() const noexceptoverride
Returns a string representation of the object.
Definition: text_area.cpp:103
static std::shared_ptr< TextArea > create(std::shared_ptr< Skin > skin, std::shared_ptr< WrappableText > text, glm::vec4 color, glm::vec4 text_color, float padding, float screen_width, float screen_height, float x_pos, float y_pos, float width, float height, const unsigned int layer)
TextArea factory function.
Definition: text_area.cpp:12
virtual void onDestroy() override
Called when the engine is shutting down.
Definition: text_area.cpp:38
virtual void onLeftClick() override
Called when element is left clicked.
Definition: text_area.cpp:67
Class for vertex data.
Definition: vertex_data.h:17
virtual void onRightClickRelease() override
Called when element has right click released over it.
Definition: text_area.cpp:77
void setText(std::shared_ptr< WrappableText > text)
Sets the text.
Definition: text_area.cpp:30
virtual void onCursorLeave() override
Called when the mouse cursor goes off the element.
Definition: text_area.cpp:84
virtual void onRightClick() override
Called when element is right clicked.
Definition: text_area.cpp:70
virtual void onCursorEnter() override
Called when the mosue cursor goes over the element.
Definition: text_area.cpp:81
std::shared_ptr< WrappableText > getText() const noexcept
Gets the text.
Definition: text_area.cpp:34
virtual void log(el::base::type::ostream_t &os) const
Definition: text_area.cpp:109
virtual void onStart() override
Called when the engine starts and when a new scene is loaded.
Definition: text_area.cpp:42
void onNotifyNow(std::shared_ptr< Events::Event > event) override
When receiving an event that is immediate, onNotifyNow is used. It acts as an interrupt to make sure ...
Definition: text_area.cpp:63
void handleQueuedEvent(std::shared_ptr< Events::Event > event) override
HandleQueuedEvent allows derived classes to define behaviour for when queuedEvents are received...
Definition: text_area.cpp:51
virtual void onKeyUp(const int key) override
Called when a key is released while element is in focus.
Definition: text_area.cpp:90
virtual void onKeyDown(const int key) override
Called when a key is pressed while element is in focus.
Definition: text_area.cpp:87
Class for UI Area.
Definition: area.h:16
Class for text area.
Definition: text_area.h:18
virtual void onScroll(const glm::dvec2 position_change) override
Called when the mouse wheel is scrolled while element is in focus.
Definition: text_area.cpp:96