![]() |
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) | |
| 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) |
| const auto & | getModalWindow () const |
| std::shared_ptr< Font > | getDefaultFont () const |
| float | getDefaultFontScale () const |
| Style & | getDefaultStyle () const |
| void | setDefaultStyle (const std::shared_ptr< Style > &style) |
| void | setDefaultFontScale (float fontScale) |
| void | setDefaultFont (std::shared_ptr< Font > &font) |
| RenderingWindow & | getRenderingWindow () const |
| float | getAspectRatio () const |
| Vector2DRenderer & | getRenderer () |
| float | getResizeDelta () const |
| void | setEnableWindowResizing (const bool enable) |
| void | drawFrame () |
| bool | onInput (const InputEvent &inputEvent) |
| WindowManager | ( | RenderingWindow & | renderingWindow | ) |
|
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 style applied to the windows that do not set their own.
|
inline |
Returns the Window blocking the input events of all the other Windows or nullptr.
|
inline |
Returns the 2D renderer used by the manager.
|
inline |
Returns the rendering window the managed windows are displayed in.
|
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 | ) |
| void setDefaultFont | ( | std::shared_ptr< Font > & | font | ) |
Sets the default font scale
| void setDefaultFontScale | ( | float | fontScale | ) |
Sets the default font scale
| void setDefaultStyle | ( | const std::shared_ptr< Style > & | style | ) |
Sets the default style applied to the windows that do not set their own.
The widgets already attached keep the UIResource built by the previous style : the resource strings are shared by the built-in styles, but the colors baked in the resource strings of the composite widgets are not updated. Rebuild the windows to apply the new style everywhere.
| style | The new default style, ignored when null. |
|
inline |
Enables or disables UI window resizing by the user.
|
friend |