|
RavEngine
|
#include <GUI.hpp>
Classes | |
| struct | GUIData |
Public Types | |
| enum class | RenderMode { Screenspace , Worldspace } |
Public Member Functions | |
| decltype(data) | GetData () const |
| void | MouseMove () |
| GUIComponent () | |
| MOVE_NO_COPY (GUIComponent) | |
| GUIComponent (int width, int height, float DPI=1) | |
| void | SetDPIScale (float scale) |
| Rml::ElementDocument * | AddDocument (const std::string &name) |
| void | RemoveDocument (const std::string &name) |
| bool | IsDocumentLoaded (const std::string &name) const |
| Rml::ElementDocument * | GetDocument (const std::string &name) const |
| void | SetDimensions (uint32_t width, uint32_t height) |
| void | MouseX (float normalized_pos) |
| void | MouseY (float normalized_pos) |
| void | ScrollY (float amt) |
| template<typename T > | |
| constexpr void | ExclusiveAccess (const T &func) |
| template<typename T > | |
| constexpr void | EnqueueUIUpdate (const T &func) |
| void | Debug () |
| bool | Update () |
| bool | Render () |
Static Public Member Functions | |
| static bool | LoadFont (const std::string &filename) |
Public Attributes | |
| enum RavEngine::GUIComponent::RenderMode | Mode = RenderMode::Screenspace |
Protected Attributes | |
| Ref< GUIData > | data = std::make_shared<GUIData>() |
Friends | |
| class | RenderEngine |
For putting interactive UI in a scene.
| GUIComponent::GUIComponent | ( | ) |
Construct a GUI document using the current screen size
| GUIComponent::GUIComponent | ( | int | width, |
| int | height, | ||
| float | DPI = 1 |
||
| ) |
Construct a GUI renderer with user-supplied size
| width | the width in pixels of the context |
| height | the height in pixels of the context |
| ElementDocument * GUIComponent::AddDocument | ( | const std::string & | name | ) |
Load a document from disk with a name
| name | the name of the RML file |
| if | this document has already been loaded into this context |
| void GUIComponent::Debug | ( | ) |
Set the RML debugger to focus on this context
|
inlineconstexpr |
Schedule a UI update. Use this call whenever you are making changes to the UI, to avoid threading issues
| func | a capturing lambda to execute. Be sure to capture by value! The passed function is executed on a different thread at a different time than the caller. |
|
inlineconstexpr |
Execute code on this element with exclusive thread-safe access. For internal use only.
| func | a lambda to execute. |
| Rml::ElementDocument * GUIComponent::GetDocument | ( | const std::string & | name | ) | const |
Get a pointer to a document, for performing queries or bindings.
| name | the name of the document. |
| if | the document is not loaded. |
| name | the name of the RML file |
| void GUIComponent::MouseX | ( | float | normalized_pos | ) |
Bind to your InputManager's mouse X axis mapping
| normalized_pos | the position of the mouse, in [0,1) |
| void GUIComponent::MouseY | ( | float | normalized_pos | ) |
Bind to your InputManager's mouse Y axis mapping
| normalized_pos | the position of the mouse, in [0,1) |
| void GUIComponent::RemoveDocument | ( | const std::string & | name | ) |
Unload a document from disk with a name
| name | the name of the RML file |
| if | this document is not loaded |
| bool GUIComponent::Render | ( | ) |
Issue draw calls to render this element (internal use only)
|
inline |
Bind to your InputManager's scroll Y axis mapping
| normalized_pos | the position of the mouse, in [0,1) |
|
inline |
Change the size of the context.
| width | the new width of the context |
| height | the new height of the context |
| bool GUIComponent::Update | ( | ) |
Recalculate based on changes made (internal use only)