![]() |
Lysa UI
0.0
Lysa UI —UI components for the Lysa Engine
|
Manages all the UI windows for a rendering window.
The WindowManager must be created as soon as possible to be the first subscriber to receive input event and stop them to be passed to scenes if they are consumed by a widget.
Public Member Functions | |
| WindowManager (RenderingWindow &renderingWindow, const std::string &defaultFontURI, float defaultFontScale=1.0f, const float4 &defaultTextColor=float4 (1.0f, 1.0f, 1.0f, 1.0f)) | |
| virtual | ~WindowManager () |
| std::shared_ptr< Window > | create (const Rect &rect) |
| std::shared_ptr< Window > | add (const std::shared_ptr< Window > &window) |
| void | remove (const std::shared_ptr< Window > &window) |
| std::shared_ptr< Font > | getDefaultFont () const |
| float | getDefaultFontScale () const |
| float4 | getDefaultTextColor () const |
| void | setDefaultFontScale (const float defaultFontScale) |
| void | setDefaultTextColor (const float4 &defaultTextColor) |
| float | getAspectRatio () const |
| Vector2DRenderer & | getRenderer () |
| float | getResizeDelta () const |
| void | setEnableWindowResizing (const bool enable) |
| void | drawFrame () |
| bool | onInput (const InputEvent &inputEvent) |
| WindowManager | ( | RenderingWindow & | renderingWindow, |
| const std::string & | defaultFontURI, | ||
| float | defaultFontScale = 1.0f, |
||
| const float4 & | defaultTextColor = float4 (1.0f, 1.0f, 1.0f, 1.0f) |
||
| ) |
| renderingWindow | The rendering window to manage UI for. |
| defaultFontURI | URI of the default font. |
| defaultFontScale | Default scale for the font. |
| defaultTextColor | Default color for text. |
|
virtual |
Adds a UI Window to the list of managed windows.
| window | The window to add. |
|
inline |
Creates and adds a UI Window to the list of managed windows.
| rect | The rectangle (position and size) of the new window. |
| void drawFrame | ( | ) |
Draws one frame of the UI.
|
inline |
Returns the aspect ratio of the managed rendering window.
|
inline |
Returns the default font loaded at creation.
|
inline |
Returns the default font scale.
|
inline |
Returns the default text color.
|
inline |
Returns the 2D renderer used by the manager.
|
inline |
Returns the resize delta for window resizing.
| bool onInput | ( | const InputEvent & | inputEvent | ) |
Handles an input event.
| inputEvent | The input event to process. |
| void remove | ( | const std::shared_ptr< Window > & | window | ) |
|
inline |
Sets the default font scale.
|
inline |
Sets the default text color.
|
inline |
Enables or disables UI window resizing by the user.