|
Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
|
Component representing a clickable button. More...
#include <Button.hpp>
Public Attributes | |
| std::string | text |
| Text displayed on the button. | |
| Vec2f | position |
| Position of the button. | |
| Vec2f | size |
| Size of the button. | |
| ButtonState | state {ButtonState::Idle} |
| Current state. | |
| std::function< void()> | onClick |
| Callback when clicked. | |
| uint8_t | idleColor [3] {100, 100, 100} |
| RGB color when idle. | |
| uint8_t | hoverColor [3] {150, 150, 150} |
| RGB color when hovered. | |
| uint8_t | pressedColor [3] {50, 50, 50} |
| RGB color when pressed. | |
Component representing a clickable button.
Definition at line 30 of file Button.hpp.
| uint8_t rtp::ecs::components::ui::Button::hoverColor[3] {150, 150, 150} |
RGB color when hovered.
Definition at line 39 of file Button.hpp.
Referenced by rtp::client::scenes::LobbyScene::buildUi(), and rtp::client::scenes::MenuScene::onEnter().
| uint8_t rtp::ecs::components::ui::Button::idleColor[3] {100, 100, 100} |
RGB color when idle.
Definition at line 38 of file Button.hpp.
Referenced by rtp::client::scenes::LobbyScene::buildUi(), and rtp::client::scenes::MenuScene::onEnter().
| std::function<void()> rtp::ecs::components::ui::Button::onClick |
Callback when clicked.
Definition at line 35 of file Button.hpp.
Referenced by rtp::client::graphics::UiFactory::createButton().
| Vec2f rtp::ecs::components::ui::Button::position |
Position of the button.
Definition at line 32 of file Button.hpp.
Referenced by rtp::client::graphics::UiFactory::createButton(), and rtp::client::UISystem::isMouseOverButton().
| uint8_t rtp::ecs::components::ui::Button::pressedColor[3] {50, 50, 50} |
RGB color when pressed.
Definition at line 40 of file Button.hpp.
Referenced by rtp::client::scenes::LobbyScene::buildUi(), and rtp::client::scenes::MenuScene::onEnter().
| Vec2f rtp::ecs::components::ui::Button::size |
Size of the button.
Definition at line 33 of file Button.hpp.
Referenced by rtp::client::graphics::UiFactory::createButton(), and rtp::client::UISystem::isMouseOverButton().
| ButtonState rtp::ecs::components::ui::Button::state {ButtonState::Idle} |
Current state.
Definition at line 34 of file Button.hpp.
Referenced by rtp::client::UISystem::handleMouseMove().
| std::string rtp::ecs::components::ui::Button::text |
Text displayed on the button.
Definition at line 31 of file Button.hpp.
Referenced by rtp::client::graphics::UiFactory::createButton().