Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
rtp::ecs::components::ui::TextInput Struct Reference

#include <TextInput.hpp>

Collaboration diagram for rtp::ecs::components::ui::TextInput:

Public Member Functions

std::string getDisplayValue () const
 

Public Attributes

Vec2f position
 
Vec2f size {320.0f, 45.0f}
 
std::string value
 
std::string placeholder {"..."}
 
std::string fontPath {"assets/fonts/main.ttf"}
 
unsigned int fontSize {22}
 
bool isFocused {false}
 
bool isPassword {false}
 
std::size_t maxLength {64}
 
bool showCursor {true}
 
float blinkTimer {0.0f}
 
float blinkInterval {0.5f}
 
std::function< void(const std::string &)> onSubmit
 
std::function< void(const std::string &)> onChange
 
uint8_t bgColor [3] {30, 30, 30}
 
uint8_t borderColor [3] {120, 120, 120}
 
uint8_t focusBorderColor [3] {100, 200, 100}
 
uint8_t textColor [3] {255, 255, 255}
 
uint8_t placeholderColor [3] {150, 150, 150}
 
uint8_t alpha {255}
 
int zIndex {5}
 

Detailed Description

Definition at line 17 of file TextInput.hpp.

Member Function Documentation

◆ getDisplayValue()

std::string rtp::ecs::components::ui::TextInput::getDisplayValue ( ) const
inline

Definition at line 45 of file TextInput.hpp.

References isPassword, and value.

Member Data Documentation

◆ alpha

uint8_t rtp::ecs::components::ui::TextInput::alpha {255}

Definition at line 42 of file TextInput.hpp.

◆ bgColor

uint8_t rtp::ecs::components::ui::TextInput::bgColor[3] {30, 30, 30}

Definition at line 37 of file TextInput.hpp.

◆ blinkInterval

float rtp::ecs::components::ui::TextInput::blinkInterval {0.5f}

Definition at line 32 of file TextInput.hpp.

◆ blinkTimer

float rtp::ecs::components::ui::TextInput::blinkTimer {0.0f}

Definition at line 31 of file TextInput.hpp.

◆ borderColor

uint8_t rtp::ecs::components::ui::TextInput::borderColor[3] {120, 120, 120}

Definition at line 38 of file TextInput.hpp.

◆ focusBorderColor

uint8_t rtp::ecs::components::ui::TextInput::focusBorderColor[3] {100, 200, 100}

Definition at line 39 of file TextInput.hpp.

◆ fontPath

std::string rtp::ecs::components::ui::TextInput::fontPath {"assets/fonts/main.ttf"}

Definition at line 23 of file TextInput.hpp.

Referenced by rtp::client::graphics::UiFactory::createTextInput().

◆ fontSize

unsigned int rtp::ecs::components::ui::TextInput::fontSize {22}

Definition at line 24 of file TextInput.hpp.

Referenced by rtp::client::graphics::UiFactory::createTextInput().

◆ isFocused

bool rtp::ecs::components::ui::TextInput::isFocused {false}

Definition at line 26 of file TextInput.hpp.

◆ isPassword

bool rtp::ecs::components::ui::TextInput::isPassword {false}

Definition at line 27 of file TextInput.hpp.

Referenced by getDisplayValue().

◆ maxLength

std::size_t rtp::ecs::components::ui::TextInput::maxLength {64}

Definition at line 28 of file TextInput.hpp.

Referenced by rtp::client::graphics::UiFactory::createTextInput().

◆ onChange

std::function<void(const std::string&)> rtp::ecs::components::ui::TextInput::onChange

Definition at line 35 of file TextInput.hpp.

Referenced by rtp::client::graphics::UiFactory::createTextInput().

◆ onSubmit

std::function<void(const std::string&)> rtp::ecs::components::ui::TextInput::onSubmit

Definition at line 34 of file TextInput.hpp.

Referenced by rtp::client::graphics::UiFactory::createTextInput().

◆ placeholder

std::string rtp::ecs::components::ui::TextInput::placeholder {"..."}

Definition at line 22 of file TextInput.hpp.

Referenced by rtp::client::graphics::UiFactory::createTextInput().

◆ placeholderColor

uint8_t rtp::ecs::components::ui::TextInput::placeholderColor[3] {150, 150, 150}

Definition at line 41 of file TextInput.hpp.

◆ position

Vec2f rtp::ecs::components::ui::TextInput::position

◆ showCursor

bool rtp::ecs::components::ui::TextInput::showCursor {true}

Definition at line 30 of file TextInput.hpp.

◆ size

Vec2f rtp::ecs::components::ui::TextInput::size {320.0f, 45.0f}

◆ textColor

uint8_t rtp::ecs::components::ui::TextInput::textColor[3] {255, 255, 255}

Definition at line 40 of file TextInput.hpp.

◆ value

◆ zIndex

int rtp::ecs::components::ui::TextInput::zIndex {5}

Definition at line 43 of file TextInput.hpp.


The documentation for this struct was generated from the following file: