![]() |
Lysa UI
0.0
Lysa UI —UI components for the Lysa Engine
|
Manages all the UI windows for a rendering window.
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 |
| auto | getDefaultFontScale () const |
| auto | getDefaultTextColor () const |
| float | getAspectRatio () const |
| void | refresh () |
| 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) |
||
| ) |
Constructor.
| 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. |
|
inline |
Forces a redrawing of all the UI at the start of the next frame.
| void remove | ( | const std::shared_ptr< Window > & | window | ) |
|
inline |
Enables or disables UI window resizing by the user.