|
Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
|
Component for dropdown menu selection. More...
#include <Dropdown.hpp>
Public Member Functions | |
| std::string | getSelected () const |
| Get currently selected option text. | |
Public Attributes | |
| Vec2f | position |
| Position of the dropdown. | |
| Vec2f | size {200.0f, 40.0f} |
| Size of the dropdown button. | |
| std::vector< std::string > | options |
| Available options. | |
| int | selectedIndex {0} |
| Currently selected option. | |
| std::function< void(int)> | onSelect |
| Callback when option selected. | |
| uint8_t | bgColor [3] {100, 100, 100} |
| RGB background color. | |
| uint8_t | hoverColor [3] {120, 120, 120} |
| RGB hover color. | |
| uint8_t | textColor [3] {255, 255, 255} |
| RGB text color. | |
| bool | isOpen {false} |
| Is dropdown menu open. | |
| int | hoveredIndex {-1} |
| Currently hovered option. | |
| int | zIndex {10} |
| Rendering order. | |
Component for dropdown menu selection.
Definition at line 21 of file Dropdown.hpp.
|
inline |
Get currently selected option text.
Definition at line 40 of file Dropdown.hpp.
References options, and selectedIndex.
| uint8_t rtp::ecs::components::ui::Dropdown::bgColor[3] {100, 100, 100} |
RGB background color.
Definition at line 29 of file Dropdown.hpp.
| uint8_t rtp::ecs::components::ui::Dropdown::hoverColor[3] {120, 120, 120} |
RGB hover color.
Definition at line 30 of file Dropdown.hpp.
| int rtp::ecs::components::ui::Dropdown::hoveredIndex {-1} |
Currently hovered option.
Definition at line 34 of file Dropdown.hpp.
| bool rtp::ecs::components::ui::Dropdown::isOpen {false} |
Is dropdown menu open.
Definition at line 33 of file Dropdown.hpp.
| std::function<void(int)> rtp::ecs::components::ui::Dropdown::onSelect |
Callback when option selected.
Definition at line 26 of file Dropdown.hpp.
Referenced by rtp::client::graphics::UiFactory::createDropdown().
| std::vector<std::string> rtp::ecs::components::ui::Dropdown::options |
Available options.
Definition at line 24 of file Dropdown.hpp.
Referenced by rtp::client::graphics::UiFactory::createDropdown(), rtp::client::UISystem::getDropdownOptionAtMouse(), and getSelected().
| Vec2f rtp::ecs::components::ui::Dropdown::position |
Position of the dropdown.
Definition at line 22 of file Dropdown.hpp.
Referenced by rtp::client::graphics::UiFactory::createDropdown(), rtp::client::UISystem::getDropdownOptionAtMouse(), and rtp::client::UISystem::isMouseOverDropdown().
| int rtp::ecs::components::ui::Dropdown::selectedIndex {0} |
Currently selected option.
Definition at line 25 of file Dropdown.hpp.
Referenced by rtp::client::graphics::UiFactory::createDropdown(), and getSelected().
| Vec2f rtp::ecs::components::ui::Dropdown::size {200.0f, 40.0f} |
Size of the dropdown button.
Definition at line 23 of file Dropdown.hpp.
Referenced by rtp::client::graphics::UiFactory::createDropdown(), rtp::client::UISystem::getDropdownOptionAtMouse(), and rtp::client::UISystem::isMouseOverDropdown().
| uint8_t rtp::ecs::components::ui::Dropdown::textColor[3] {255, 255, 255} |
RGB text color.
Definition at line 31 of file Dropdown.hpp.
| int rtp::ecs::components::ui::Dropdown::zIndex {10} |
Rendering order.
Definition at line 35 of file Dropdown.hpp.