16 std::shared_ptr<WrappableText> default_text;
17 std::shared_ptr<WrappableText> typed_text;
21 std::string current_typed;
22 glm::vec4 typed_color;
38 TextField(std::shared_ptr<WrappableText> default_text, std::shared_ptr<WrappableText> typed_text,
VertexData vertex_data, std::shared_ptr<Skin> skin,
const unsigned int layer);
56 static std::shared_ptr<TextField>
create(std::shared_ptr<Skin> skin, std::shared_ptr<WrappableText> default_text, std::shared_ptr<WrappableText> typed_text, glm::vec4 background_color,
float padding,
float screen_width,
float screen_height,
float x_pos,
float y_pos,
float width,
float height,
const unsigned int layer);
64 virtual void onKeyDown(
const int key)
override;
65 virtual void onKeyUp(
const int key)
override;
67 virtual void onScroll(
const glm::dvec2 position_change)
override;
74 virtual std::string
to_string() const noexcept override;
75 virtual std::
string className() const noexcept override;
79 virtual
void onStart() override;
80 virtual
bool onUpdate(const
double delta) override;
83 void onNotifyNow(std::shared_ptr<Events::Event> event) override;
85 virtual
void log(el::base::type::ostream_t& os) const;
const glm::vec4 mouse_over_dim
Definition: text_field.h:26
virtual void onKeyRepeat(const int key) override
Called when a key is repeated while element is in focus.
Definition: text_field.cpp:134
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_field.cpp:72
virtual void onCharacterTyped(const unsigned char character)
Definition: text_field.cpp:145
virtual void onKeyUp(const int key) override
Called when a key is released while element is in focus.
Definition: text_field.cpp:131
virtual void onCursorEnter() override
Called when the mosue cursor goes over the element.
Definition: text_field.cpp:98
virtual void onLeftClick() override
Called when element is left clicked.
Definition: text_field.cpp:76
virtual void onDestroy() override
Called when the engine is shutting down.
Definition: text_field.cpp:47
Class for vertex data.
Definition: vertex_data.h:17
virtual void onRightClickRelease() override
Called when element has right click released over it.
Definition: text_field.cpp:94
virtual void log(el::base::type::ostream_t &os) const
Definition: text_field.cpp:163
virtual void onScroll(const glm::dvec2 position_change) override
Called when the mouse wheel is scrolled while element is in focus.
Definition: text_field.cpp:142
virtual void onKeyDown(const int key) override
Called when a key is pressed while element is in focus.
Definition: text_field.cpp:106
virtual void onRightClick() override
Called when element is right clicked.
Definition: text_field.cpp:87
virtual void onCursorLeave() override
Called when the mouse cursor goes off the element.
Definition: text_field.cpp:102
TextField(std::shared_ptr< WrappableText > default_text, std::shared_ptr< WrappableText > typed_text, VertexData vertex_data, std::shared_ptr< Skin > skin, const unsigned int layer)
TextField constructor.
Definition: text_field.cpp:14
static std::shared_ptr< TextField > create(std::shared_ptr< Skin > skin, std::shared_ptr< WrappableText > default_text, std::shared_ptr< WrappableText > typed_text, glm::vec4 background_color, float padding, float screen_width, float screen_height, float x_pos, float y_pos, float width, float height, const unsigned int layer)
TextField factory function.
Definition: text_field.cpp:19
Class for text area.
Definition: text_area.h:18
void handleQueuedEvent(std::shared_ptr< Events::Event > event) override
HandleQueuedEvent allows derived classes to define behaviour for when queuedEvents are received...
Definition: text_field.cpp:64
Class for text field.
Definition: text_field.h:13
virtual void onStart() override
Called when the engine starts and when a new scene is loaded.
Definition: text_field.cpp:51
virtual void onLeftClickRelease() override
Called when element has left click released over it.
Definition: text_field.cpp:90
virtual std::string className() const noexceptoverride
Returns a string representing the class name.
Definition: text_field.cpp:153
virtual bool onUpdate(const double delta) override
Called every engine loop.
Definition: text_field.cpp:60
virtual std::string to_string() const noexceptoverride
Returns a string representation of the object.
Definition: text_field.cpp:157