|
Plutonium framework API 1.0.0
Easy-to-use, SDL2-based UI framework for Nintendo Switch homebrew
|
Element for creating UI progress bars. More...
#include <elm_ProgressBar.hpp>
Public Member Functions | |
| ProgressBar (const i32 x, const i32 y, const i32 width, const i32 height, const double max_val) | |
| Creates a new instance of a ProgressBar. | |
| i32 | GetX () override |
| Gets the X position of the Element. | |
| void | SetX (const i32 x) |
| Sets the X position of the ProgressBar. | |
| i32 | GetY () override |
| Gets the Y position of the Element. | |
| void | SetY (const i32 y) |
| Sets the Y position of the ProgressBar. | |
| i32 | GetWidth () override |
| Gets the width of the Element. | |
| void | SetWidth (const i32 width) |
| Sets the width of the ProgressBar. | |
| i32 | GetHeight () override |
| Gets the height of the Element. | |
| void | SetHeight (const i32 height) |
| Sets the height of the ProgressBar. | |
| void | SetProgress (const double progress) |
| Sets the progress of the ProgressBar. | |
| void | IncrementProgress (const double extra_progress) |
| Increments the progress of the ProgressBar. | |
| void | DecrementProgress (const double extra_progress) |
| Decrements the progress of the ProgressBar. | |
| void | FillProgress () |
| Fills the ProgressBar up to the maximum value. | |
| void | ClearProgress () |
| Clears the ProgressBar progress. | |
| bool | IsCompleted () |
| Gets whether the ProgressBar is completed. | |
| void | OnRender (render::Renderer::Ref &drawer, const i32 x, const i32 y) override |
| Renders the Element on the screen. | |
| void | OnInput (const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos) override |
| Called before rendering the Element in order to handle input. | |
Public Member Functions inherited from pu::ui::elm::Element | |
| Element () | |
| Creates a new instance of an Element. | |
| virtual | ~Element () |
| bool | IsVisible () |
| Gets whether the Element is visible. | |
| void | SetVisible (const bool visible) |
| Sets whether the Element is visible. | |
| void | SetHorizontalAlign (const HorizontalAlign align) |
| Sets the horizontal alignment of the Element. | |
| HorizontalAlign | GetHorizontalAlign () |
| Gets the horizontal alignment of the Element. | |
| void | SetVerticalAlign (const VerticalAlign align) |
| Sets the vertical alignment of the Element. | |
| VerticalAlign | GetVerticalAlign () |
| Gets the vertical alignment of the Element. | |
| void | SetParentContainer (Container *parent_container) |
| Sets the parent Container of the Element. | |
| i32 | GetProcessedX () |
| Gets the actual X position of the Element, considering the parent Container (depends on alignment). | |
| i32 | GetProcessedY () |
| Gets the actual Y position of the Element, considering the parent Container (depends on alignment). | |
Static Public Attributes | |
| static constexpr Color | DefaultProgressColor = { 139, 195, 74, 255 } |
| static constexpr Color | DefaultBackgroundColor = { 140, 140, 140, 255 } |
| static constexpr double | DefaultHeightRadiusFactor = 0.333 |
Additional Inherited Members | |
Protected Attributes inherited from pu::ui::elm::Element | |
| bool | visible |
| HorizontalAlign | h_align |
| VerticalAlign | v_align |
| Container * | parent_container |
Element for creating UI progress bars.
| pu::ui::elm::ProgressBar::ProgressBar | ( | const i32 | x, |
| const i32 | y, | ||
| const i32 | width, | ||
| const i32 | height, | ||
| const double | max_val ) |
Creates a new instance of a ProgressBar.
| x | X position of the ProgressBar. |
| y | Y position of the ProgressBar. |
| width | Width of the ProgressBar. |
| height | Height of the ProgressBar. |
| max_val | Maximum value of the ProgressBar. |
|
inline |
Clears the ProgressBar progress.
|
inline |
Decrements the progress of the ProgressBar.
| extra_progress | Extra progress to subtract, with respect to the maximum value. |
|
inline |
Fills the ProgressBar up to the maximum value.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Gets the X position of the Element.
Implements pu::ui::elm::Element.
|
inlineoverridevirtual |
Gets the Y position of the Element.
Implements pu::ui::elm::Element.
|
inline |
Increments the progress of the ProgressBar.
| extra_progress | Extra progress to add, with respect to the maximum value. |
|
inline |
Gets whether the ProgressBar is completed.
|
inlineoverridevirtual |
Called before rendering the Element in order to handle input.
| keys_down | Keys that are currently being pressed. |
| keys_up | Keys that are currently being released. |
| keys_held | Keys that are currently held. |
| touch_pos | Position of the touch on the screen. |
Implements pu::ui::elm::Element.
|
overridevirtual |
Renders the Element on the screen.
| drawer | Renderer to use for rendering. |
| x | X position to render the Element. |
| y | Y position to render the Element. |
Implements pu::ui::elm::Element.
|
inline |
Sets the height of the ProgressBar.
| height | New height. |
| void pu::ui::elm::ProgressBar::SetProgress | ( | const double | progress | ) |
Sets the progress of the ProgressBar.
| progress | Progress to set, with respect to the maximum value. |
|
inline |
Sets the width of the ProgressBar.
| width | New width. |
|
inline |
Sets the X position of the ProgressBar.
| x | New X position. |
|
inline |
Sets the Y position of the ProgressBar.
| y | New Y position. |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |