lxgui
|
Manages the user interface. More...
#include <gui_manager.hpp>
Public Member Functions | |
manager (utils::control_block &block, std::unique_ptr< input::source > src, std::unique_ptr< renderer > rdr) | |
Constructor. | |
~manager () override | |
Destructor. | |
manager (const manager &)=delete | |
manager (manager &&)=delete | |
manager & | operator= (const manager &)=delete |
manager & | operator= (manager &&)=delete |
void | set_interface_scaling_factor (float scaling_factor) |
Sets the global UI scaling factor. | |
float | get_interface_scaling_factor () const |
Returns the current UI scaling factor. | |
void | enable_caching (bool enable_caching) |
Enables or disables interface caching. | |
void | toggle_caching () |
Toggles interface caching. | |
bool | is_caching_enabled () const |
Checks if interface caching is enabled. | |
void | add_addon_directory (const std::string &directory) |
Adds a new directory to be parsed for UI addons. | |
void | clear_addon_directory_list () |
Clears the addon directory list. | |
void | add_localization_directory (const std::string &directory) |
Adds a new directory to be parsed for localization. | |
void | clear_localization_directory_list () |
Clears the localization directory list. | |
std::string | print_ui () const |
Prints debug information in the log file. | |
void | load_ui () |
Loads the UI. | |
void | close_ui () |
Closes the UI safely (at the end of update_ui()). | |
void | close_ui_now () |
Closes the UI (immediately). | |
void | reload_ui () |
Closes the UI and load it again safely (at the end of update_ui()). | |
void | reload_ui_now () |
Closes the UI and load it again (immediately). | |
bool | is_loaded () const |
Checks if the UI has been loaded. | |
void | render_ui () const |
Renders the UI into the current render target. | |
void | update_ui (float delta) |
Updates this manager and its regions. | |
sol::state & | get_lua () |
Returns the GUI Lua state (sol wrapper). | |
const sol::state & | get_lua () const |
Returns the GUI Lua state (sol wrapper). | |
const renderer & | get_renderer () const |
Returns the renderer implementation. | |
renderer & | get_renderer () |
Returns the renderer implementation. | |
const input::window & | get_window () const |
Returns the window in which this gui is being displayed. | |
input::window & | get_window () |
Returns the window in which this gui is being displayed. | |
const input::dispatcher & | get_input_dispatcher () const |
Returns the input manager associated to this gui. | |
input::dispatcher & | get_input_dispatcher () |
Returns the input manager associated to this gui. | |
const input::world_dispatcher & | get_world_input_dispatcher () const |
Returns the input manager associated to this gui. | |
input::world_dispatcher & | get_world_input_dispatcher () |
Returns the input manager associated to this gui. | |
const event_emitter & | get_event_emitter () const |
Returns the gui event emitter. | |
event_emitter & | get_event_emitter () |
Returns the gui event emitter. | |
localizer & | get_localizer () |
Returns the object used for localizing strings. | |
const localizer & | get_localizer () const |
Returns the object used for localizing strings. | |
root & | get_root () |
Returns the UI root object, which contains root frames. | |
const root & | get_root () const |
Returns the UI root object, which contains root frames. | |
virtual_root & | get_virtual_root () |
Returns the UI root object, which contains root frames. | |
const virtual_root & | get_virtual_root () const |
Returns the UI root object, which contains root frames. | |
factory & | get_factory () |
Returns the UI object factory, which is used to create new objects. | |
const factory & | get_factory () const |
Returns the UI object factory, which is used to create new objects. | |
addon_registry * | get_addon_registry () |
Returns the addon registry, which keeps track of loaded addons. | |
const addon_registry * | get_addon_registry () const |
Returns the addon registry, which keeps track of loaded addons. | |
Public Attributes | |
utils::signal< void(sol::state &)> | on_create_lua |
Triggers on each fresh Lua state (e.g., on startup or after a UI re-load). | |
Manages the user interface.
Definition at line 44 of file gui_manager.hpp.
lxgui::gui::manager::manager | ( | utils::control_block & | block, |
std::unique_ptr< input::source > | src, | ||
std::unique_ptr< renderer > | rdr | ||
) |
Constructor.
block | The owner pointer control block |
src | The input source to use |
rdr | The renderer implementation |
Definition at line 36 of file gui_manager.cpp.
|
override |
Destructor.
Definition at line 66 of file gui_manager.cpp.
|
delete |
|
delete |
void lxgui::gui::manager::add_addon_directory | ( | const std::string & | directory | ) |
Adds a new directory to be parsed for UI addons.
directory | The new directory |
Definition at line 110 of file gui_manager.cpp.
void lxgui::gui::manager::add_localization_directory | ( | const std::string & | directory | ) |
Adds a new directory to be parsed for localization.
directory | The new directory |
Definition at line 119 of file gui_manager.cpp.
void lxgui::gui::manager::clear_addon_directory_list | ( | ) |
Clears the addon directory list.
Definition at line 115 of file gui_manager.cpp.
void lxgui::gui::manager::clear_localization_directory_list | ( | ) |
Clears the localization directory list.
Definition at line 124 of file gui_manager.cpp.
void lxgui::gui::manager::close_ui | ( | ) |
Closes the UI safely (at the end of update_ui()).
Definition at line 165 of file gui_manager.cpp.
void lxgui::gui::manager::close_ui_now | ( | ) |
Closes the UI (immediately).
Definition at line 169 of file gui_manager.cpp.
void lxgui::gui::manager::enable_caching | ( | bool | enable_caching | ) |
Enables or disables interface caching.
enable_caching | 'true' to enable, 'false' to disable |
Definition at line 91 of file gui_manager.cpp.
|
inline |
Returns the addon registry, which keeps track of loaded addons.
Definition at line 383 of file gui_manager.hpp.
|
inline |
Returns the addon registry, which keeps track of loaded addons.
Definition at line 391 of file gui_manager.hpp.
|
inline |
Returns the gui event emitter.
Definition at line 311 of file gui_manager.hpp.
|
inline |
Returns the gui event emitter.
Definition at line 303 of file gui_manager.hpp.
|
inline |
Returns the UI object factory, which is used to create new objects.
Definition at line 367 of file gui_manager.hpp.
|
inline |
Returns the UI object factory, which is used to create new objects.
Definition at line 375 of file gui_manager.hpp.
|
inline |
Returns the input manager associated to this gui.
Definition at line 279 of file gui_manager.hpp.
|
inline |
Returns the input manager associated to this gui.
Definition at line 271 of file gui_manager.hpp.
float lxgui::gui::manager::get_interface_scaling_factor | ( | ) | const |
Returns the current UI scaling factor.
Definition at line 87 of file gui_manager.cpp.
|
inline |
Returns the object used for localizing strings.
Definition at line 319 of file gui_manager.hpp.
|
inline |
Returns the object used for localizing strings.
Definition at line 327 of file gui_manager.hpp.
sol::state & lxgui::gui::manager::get_lua | ( | ) |
Returns the GUI Lua state (sol wrapper).
Definition at line 128 of file gui_manager.cpp.
const sol::state & lxgui::gui::manager::get_lua | ( | ) | const |
Returns the GUI Lua state (sol wrapper).
Definition at line 132 of file gui_manager.cpp.
|
inline |
Returns the renderer implementation.
Definition at line 247 of file gui_manager.hpp.
|
inline |
Returns the renderer implementation.
Definition at line 239 of file gui_manager.hpp.
|
inline |
Returns the UI root object, which contains root frames.
Definition at line 335 of file gui_manager.hpp.
|
inline |
Returns the UI root object, which contains root frames.
Definition at line 343 of file gui_manager.hpp.
|
inline |
Returns the UI root object, which contains root frames.
Definition at line 351 of file gui_manager.hpp.
|
inline |
Returns the UI root object, which contains root frames.
Definition at line 359 of file gui_manager.hpp.
|
inline |
Returns the window in which this gui is being displayed.
Definition at line 263 of file gui_manager.hpp.
|
inline |
Returns the window in which this gui is being displayed.
Definition at line 255 of file gui_manager.hpp.
|
inline |
Returns the input manager associated to this gui.
Definition at line 295 of file gui_manager.hpp.
|
inline |
Returns the input manager associated to this gui.
Definition at line 287 of file gui_manager.hpp.
bool lxgui::gui::manager::is_caching_enabled | ( | ) | const |
Checks if interface caching is enabled.
Definition at line 103 of file gui_manager.cpp.
bool lxgui::gui::manager::is_loaded | ( | ) | const |
Checks if the UI has been loaded.
Definition at line 211 of file gui_manager.cpp.
void lxgui::gui::manager::load_ui | ( | ) |
Loads the UI.
Definition at line 150 of file gui_manager.cpp.
std::string lxgui::gui::manager::print_ui | ( | ) | const |
Prints debug information in the log file.
Definition at line 234 of file gui_manager.cpp.
void lxgui::gui::manager::reload_ui | ( | ) |
Closes the UI and load it again safely (at the end of update_ui()).
Definition at line 189 of file gui_manager.cpp.
void lxgui::gui::manager::reload_ui_now | ( | ) |
Closes the UI and load it again (immediately).
Definition at line 193 of file gui_manager.cpp.
void lxgui::gui::manager::render_ui | ( | ) | const |
Renders the UI into the current render target.
Definition at line 203 of file gui_manager.cpp.
void lxgui::gui::manager::set_interface_scaling_factor | ( | float | scaling_factor | ) |
Sets the global UI scaling factor.
scaling_factor | The factor to use for rescaling (1: no rescaling, default) |
Definition at line 70 of file gui_manager.cpp.
void lxgui::gui::manager::toggle_caching | ( | ) |
Toggles interface caching.
Definition at line 97 of file gui_manager.cpp.
void lxgui::gui::manager::update_ui | ( | float | delta | ) |
Updates this manager and its regions.
delta | The time elapsed since the last call |
Definition at line 215 of file gui_manager.cpp.
utils::signal<void(sol::state&)> lxgui::gui::manager::on_create_lua |
Triggers on each fresh Lua state (e.g., on startup or after a UI re-load).
Definition at line 157 of file gui_manager.hpp.