|
| | Slider (float min=0.0f, float max=1.0f, float initial_value=0.5f, const std::string &name="Slider") |
| | Constructor for Slider.
|
|
| ~Slider () override=default |
| | Destructor.
|
| void | set_value (float value) |
| | Set the slider value.
|
| float | get_value () const |
| | Get the current value.
|
| void | set_range (float min, float max) |
| | Set the value range.
|
| void | set_label (const std::string &label) |
| | Set the label text.
|
| void | set_on_value_changed (std::function< void(float)> callback) |
| | Set callback for value changes.
|
| void | set_show_value (bool show) |
| | Set whether to show the value as text.
|
| std::shared_ptr< Text > | get_label_text () |
| | Get the label text element (for setting font).
|
| std::shared_ptr< Text > | get_value_text () |
| | Get the value text element (for setting font).
|
| bool | contains_point (float x, float y, float canvas_width, float canvas_height) const |
| | Check if point is inside slider.
|
| bool | handle_mouse_button (float x, float y, bool pressed, float canvas_width, float canvas_height) |
| | Handle mouse button event.
|
| void | handle_mouse_drag (float x, float y, float canvas_width, float canvas_height) |
| | Handle mouse drag.
|
| void | render (float canvas_width, float canvas_height, const glm::mat4 &projection) override |
| | Render the slider.
|
| | UIElement (const std::string &name="UIElement") |
| | Constructor for UIElement.
|
|
virtual | ~UIElement ()=default |
| | Virtual destructor.
|
| void | set_position (const glm::vec2 &position) |
| | Set the position of the UI element.
|
| void | set_size (const glm::vec2 &size) |
| | Set the size of the UI element.
|
| void | set_anchor (Anchor anchor) |
| | Set the anchor of the UI element.
|
| void | set_render_order (int order) |
| | Set the render order (z-index).
|
| void | set_visible (bool visible) |
| | Set visibility of the UI element.
|
| void | set_name (const std::string &name) |
| | Set the name of the UI element.
|
| const glm::vec2 & | get_position () const |
| | Get the position of the UI element.
|
| const glm::vec2 & | get_size () const |
| | Get the size of the UI element.
|
| Anchor | get_anchor () const |
| | Get the anchor of the UI element.
|
| int | get_render_order () const |
| | Get the render order.
|
| bool | is_visible () const |
| | Check if the UI element is visible.
|
| const std::string & | get_name () const |
| | Get the name of the UI element.
|
| std::shared_ptr< UIElement > | get_parent () const |
| | Get the parent UI element.
|
| void | add_child (const std::shared_ptr< UIElement > child) |
| | Add a child UI element.
|
| void | remove_child (const std::shared_ptr< UIElement > child) |
| | Remove a child UI element.
|
| std::vector< std::shared_ptr< UIElement > > | get_children () const |
| | Get all child UI elements.
|
| glm::vec2 | get_absolute_position (float canvas_width, float canvas_height) const |
| | Compute the absolute screen position based on anchor and parent.
|
Horizontal slider UI element.