4#include "UIComponent.h"
5#include "../Inputable/Inputable.h"
6#include "../Sprites/SpriteString.h"
71 const std::string&
GetText()
const;
131 void KeyPress(AZUL_KEY key)
override;
137 void KeyHeld(AZUL_KEY key)
override;
Represents a sprite in the SUNENGINE.
Definition Sprites/SUNENGINESprite.h:16
Represents a string of sprites in the SUNENGINE.
Definition SpriteString.h:18
bool capsLock
True if caps lock is active.
Definition Textbox.h:123
float posY
Y position of the textbox center.
Definition Textbox.h:115
float scaleX
X scale factor.
Definition Textbox.h:118
void SetLayer(int layer) override
Sets the rendering layer of the textbox.
Definition Textbox.cpp:54
void KeyHeld(AZUL_KEY key) override
Handles key held events for text input and editing.
Definition Textbox.cpp:216
bool isFocused
True if the textbox is focused for input.
Definition Textbox.h:121
void OnPress() override
Handles mouse press events (focuses the textbox).
Definition Textbox.cpp:92
char GetCharFromKey(AZUL_KEY key, bool shiftHeld)
Sets the focus to the textbox (starts receiving keyboard input).
Definition Textbox.cpp:101
void UpdateTextLabel()
Updates the world matrix of the textbox.
Definition Textbox.cpp:232
void SetScale(float x, float y)
Sets the scale of the textbox.
Definition Textbox.cpp:46
void Render() override
Renders the textbox background and text label.
Definition Textbox.cpp:73
float height
Height of the textbox.
Definition Textbox.h:117
void SetTextSize(float x, float y)
Sets the size of the text in the textbox.
Definition Textbox.cpp:154
int characterLimit
Maximum number of characters allowed in the textbox.
Definition Textbox.h:125
void SetPosition(float x, float y)
Sets the text label of the textbox.
Definition Textbox.cpp:38
void KeyboardDereg()
Handles deregistration when the textbox is unfocused.
Definition Textbox.cpp:482
void KeyRelease(AZUL_KEY key) override
Handles key release events.
Definition Textbox.cpp:224
void ClearText()
Clears the current text in the textbox.
Definition Textbox.cpp:137
SUNENGINESprite * pBackgroundSprite
Background sprite for the textbox.
Definition Textbox.h:109
std::string text
Current text in the textbox.
Definition Textbox.h:111
bool IsMouseOver(float x, float y) override
Checks if the mouse is over the textbox.
Definition Textbox.cpp:82
bool shiftHeld
True if shift is currently held.
Definition Textbox.h:122
SpriteString * pTextLabel
Text label for displaying input.
Definition Textbox.h:110
const std::string & GetText() const
Gets the current text in the textbox.
Definition Textbox.cpp:59
void SetCharacterLimit(int limit)
Sets the maximum number of characters allowed in the textbox.
Definition Textbox.cpp:143
void LoseFocus()
Removes focus from the textbox (stops receiving keyboard input).
Definition Textbox.cpp:64
void SetTextSizePixel(float x, float y)
Sets the size of the text in the textbox by pixel dimensions.
Definition Textbox.cpp:167
std::string fontKey
Font key for the text label.
Definition Textbox.h:112
void KeyboardReg()
Handles registration when the textbox is focused.
Definition Textbox.cpp:425
void KeyPress(AZUL_KEY key) override
Handles key press events for text input and editing.
Definition Textbox.cpp:180
float width
Width of the textbox.
Definition Textbox.h:116
float scaleY
Y scale factor.
Definition Textbox.h:119
Textbox()=default
Default constructor (for serialization).
float posX
X position of the textbox center.
Definition Textbox.h:114
Abstract base class for all UI components.
Definition UIComponent.h:32