|
Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
|
Component for a draggable slider control. More...
#include <Slider.hpp>
Public Member Functions | |
| float | getNormalized () const |
| Get normalized value (0-1) | |
| void | setNormalized (float normalized) |
| Set value from normalized (0-1) | |
Public Attributes | |
| Vec2f | position |
| Position of the slider. | |
| Vec2f | size {200.0f, 20.0f} |
| Size of the slider. | |
| float | minValue {0.0f} |
| Minimum value. | |
| float | maxValue {1.0f} |
| Maximum value. | |
| float | currentValue {0.5f} |
| Current value. | |
| std::function< void(float)> | onChange |
| Callback when value changes. | |
| uint8_t | trackColor [3] {80, 80, 80} |
| RGB color of track. | |
| uint8_t | fillColor [3] {100, 200, 100} |
| RGB color of filled part. | |
| uint8_t | handleColor [3] {200, 200, 200} |
| RGB color of handle. | |
| bool | isDragging {false} |
| Is currently being dragged. | |
| int | zIndex {5} |
| Rendering order. | |
Component for a draggable slider control.
Definition at line 19 of file Slider.hpp.
|
inline |
Get normalized value (0-1)
Definition at line 38 of file Slider.hpp.
References currentValue, maxValue, and minValue.
|
inline |
Set value from normalized (0-1)
Definition at line 45 of file Slider.hpp.
References currentValue, maxValue, and minValue.
| float rtp::ecs::components::ui::Slider::currentValue {0.5f} |
Current value.
Definition at line 24 of file Slider.hpp.
Referenced by rtp::client::graphics::UiFactory::createSlider(), getNormalized(), setNormalized(), and rtp::client::UISystem::updateSliderValue().
| uint8_t rtp::ecs::components::ui::Slider::fillColor[3] {100, 200, 100} |
RGB color of filled part.
Definition at line 29 of file Slider.hpp.
| uint8_t rtp::ecs::components::ui::Slider::handleColor[3] {200, 200, 200} |
RGB color of handle.
Definition at line 30 of file Slider.hpp.
| bool rtp::ecs::components::ui::Slider::isDragging {false} |
Is currently being dragged.
Definition at line 32 of file Slider.hpp.
Referenced by rtp::client::UISystem::handleMouseClick().
| float rtp::ecs::components::ui::Slider::maxValue {1.0f} |
Maximum value.
Definition at line 23 of file Slider.hpp.
Referenced by rtp::client::graphics::UiFactory::createSlider(), getNormalized(), setNormalized(), and rtp::client::UISystem::updateSliderValue().
| float rtp::ecs::components::ui::Slider::minValue {0.0f} |
Minimum value.
Definition at line 22 of file Slider.hpp.
Referenced by rtp::client::graphics::UiFactory::createSlider(), getNormalized(), setNormalized(), and rtp::client::UISystem::updateSliderValue().
| std::function<void(float)> rtp::ecs::components::ui::Slider::onChange |
Callback when value changes.
Definition at line 25 of file Slider.hpp.
Referenced by rtp::client::graphics::UiFactory::createSlider(), and rtp::client::UISystem::updateSliderValue().
| Vec2f rtp::ecs::components::ui::Slider::position |
Position of the slider.
Definition at line 20 of file Slider.hpp.
Referenced by rtp::client::graphics::UiFactory::createSlider(), rtp::client::UISystem::isMouseOverSlider(), and rtp::client::UISystem::updateSliderValue().
| Vec2f rtp::ecs::components::ui::Slider::size {200.0f, 20.0f} |
Size of the slider.
Definition at line 21 of file Slider.hpp.
Referenced by rtp::client::graphics::UiFactory::createSlider(), rtp::client::UISystem::isMouseOverSlider(), and rtp::client::UISystem::updateSliderValue().
| uint8_t rtp::ecs::components::ui::Slider::trackColor[3] {80, 80, 80} |
RGB color of track.
Definition at line 28 of file Slider.hpp.
| int rtp::ecs::components::ui::Slider::zIndex {5} |
Rendering order.
Definition at line 33 of file Slider.hpp.