|
Plutonium framework API 1.0.0
Easy-to-use, SDL2-based UI framework for Nintendo Switch homebrew
|
Base class for all UI elements in Plutonium, providing basic functionality for all of them. More...
#include <elm_Element.hpp>
Public Member Functions | |
| Element () | |
| Creates a new instance of an Element. | |
| virtual | ~Element () |
| virtual i32 | GetX ()=0 |
| Gets the X position of the Element. | |
| virtual i32 | GetY ()=0 |
| Gets the Y position of the Element. | |
| virtual i32 | GetWidth ()=0 |
| Gets the width of the Element. | |
| virtual i32 | GetHeight ()=0 |
| Gets the height of the Element. | |
| virtual void | OnRender (render::Renderer::Ref &drawer, const i32 x, const i32 y)=0 |
| Renders the Element on the screen. | |
| virtual void | OnInput (const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos)=0 |
| Called before rendering the Element in order to handle input. | |
| 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). | |
Protected Attributes | |
| bool | visible |
| HorizontalAlign | h_align |
| VerticalAlign | v_align |
| Container * | parent_container |
Base class for all UI elements in Plutonium, providing basic functionality for all of them.
|
inline |
Creates a new instance of an Element.
|
inlinevirtual |
|
pure virtual |
Gets the height of the Element.
Implemented in pu::ui::elm::Button, pu::ui::elm::Image, pu::ui::elm::Menu, pu::ui::elm::ProgressBar, pu::ui::elm::Rectangle, pu::ui::elm::TextBlock, and pu::ui::elm::Toggle.
|
inline |
| i32 pu::ui::elm::Element::GetProcessedX | ( | ) |
| i32 pu::ui::elm::Element::GetProcessedY | ( | ) |
|
inline |
|
pure virtual |
Gets the width of the Element.
Implemented in pu::ui::elm::Button, pu::ui::elm::Image, pu::ui::elm::Menu, pu::ui::elm::ProgressBar, pu::ui::elm::Rectangle, pu::ui::elm::TextBlock, and pu::ui::elm::Toggle.
|
pure virtual |
Gets the X position of the Element.
Implemented in pu::ui::elm::Button, pu::ui::elm::Image, pu::ui::elm::Menu, pu::ui::elm::ProgressBar, pu::ui::elm::Rectangle, pu::ui::elm::TextBlock, and pu::ui::elm::Toggle.
|
pure virtual |
Gets the Y position of the Element.
Implemented in pu::ui::elm::Button, pu::ui::elm::Image, pu::ui::elm::Menu, pu::ui::elm::ProgressBar, pu::ui::elm::Rectangle, pu::ui::elm::TextBlock, and pu::ui::elm::Toggle.
|
inline |
|
pure virtual |
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. |
Implemented in pu::ui::elm::Button, pu::ui::elm::Image, pu::ui::elm::Menu, pu::ui::elm::ProgressBar, pu::ui::elm::Rectangle, pu::ui::elm::TextBlock, and pu::ui::elm::Toggle.
|
pure virtual |
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. |
Implemented in pu::ui::elm::Button, pu::ui::elm::Image, pu::ui::elm::Menu, pu::ui::elm::ProgressBar, pu::ui::elm::Rectangle, pu::ui::elm::TextBlock, and pu::ui::elm::Toggle.
|
inline |
Sets the horizontal alignment of the Element.
| align | New horizontal alignment to set. |
|
inline |
Sets the parent Container of the Element.
| parent_container | New parent Container to set. |
|
inline |
Sets the vertical alignment of the Element.
| align | New vertical alignment to set. |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |