|
Plutonium framework API 1.0.0
Easy-to-use, SDL2-based UI framework for Nintendo Switch homebrew
|
Element for toggling between two states. More...
#include <elm_Toggle.hpp>
Public Member Functions | |
| Toggle (const i32 x, const i32 y, const std::string &content, const u64 toggle_key, const Color clr) | |
| Creates a new instance of a Toggle element. | |
| ~Toggle () | |
| i32 | GetX () override |
| Gets the X position of the Element. | |
| void | SetX (const i32 x) |
| Sets the X position of the Toggle. | |
| i32 | GetY () override |
| Gets the Y position of the Element. | |
| void | SetY (const i32 y) |
| Sets the Y position of the Toggle. | |
| i32 | GetWidth () override |
| Gets the width of the Element. | |
| i32 | GetHeight () override |
| Gets the height of the Element. | |
| std::string | GetContent () |
| Gets the content of the Toggle. | |
| void | SetContent (const std::string &content) |
| Sets the content of the Toggle. | |
| void | SetFont (const std::string &font_name) |
| Gets the font name of the Toggle. | |
| void | SetColor (const Color clr) |
| Sets the color of the Toggle. | |
| 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 u32 | DefaultContentHorizontalMargin = 30 |
| static constexpr u32 | DefaultContentVerticalMargin = 20 |
| static constexpr DefaultFontSize | DefaultContentFontSize = DefaultFontSize::MediumLarge |
| static constexpr u8 | DefaultToggleAlphaIncrement = 48 |
| static constexpr Color | DefaultBackgroundColor = { 130, 130, 130, 255 } |
Additional Inherited Members | |
Protected Attributes inherited from pu::ui::elm::Element | |
| bool | visible |
| HorizontalAlign | h_align |
| VerticalAlign | v_align |
| Container * | parent_container |
Element for toggling between two states.
| pu::ui::elm::Toggle::~Toggle | ( | ) |
|
inline |
|
overridevirtual |
|
overridevirtual |
|
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.
|
overridevirtual |
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.
| void pu::ui::elm::Toggle::SetColor | ( | const Color | clr | ) |
| void pu::ui::elm::Toggle::SetContent | ( | const std::string & | content | ) |
| void pu::ui::elm::Toggle::SetFont | ( | const std::string & | font_name | ) |
|
inline |
Sets the X position of the Toggle.
| x | New X position. |
|
inline |
Sets the Y position of the Toggle.
| y | New Y position. |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |