lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
Loading...
Searching...
No Matches
lmgl::ui::UILoader Class Reference

JSON-based UI loader. More...

#include <ui_loader.hpp>

Public Member Functions

 UILoader ()
 Constructor.
UILoadResult load_from_file (const std::string &filepath, const UICallbackRegistry &callbacks)
 Load UI from JSON file.
UILoadResult load_from_string (const std::string &json_str, const UICallbackRegistry &callbacks)
 Load UI from JSON string.
void set_base_path (const std::string &base_path)
 Set base path for resolving relative paths (fonts, images).

Detailed Description

JSON-based UI loader.

Loads UI definitions from JSON files and creates UI elements.

Member Function Documentation

◆ load_from_file()

UILoadResult lmgl::ui::UILoader::load_from_file ( const std::string & filepath,
const UICallbackRegistry & callbacks )

Load UI from JSON file.

Parameters
filepathPath to JSON file.
callbacksCallback registry for event handlers.
Returns
Load result with canvas and elements.

◆ load_from_string()

UILoadResult lmgl::ui::UILoader::load_from_string ( const std::string & json_str,
const UICallbackRegistry & callbacks )

Load UI from JSON string.

Parameters
json_strJSON string.
callbacksCallback registry for event handlers.
Returns
Load result with canvas and elements.

◆ set_base_path()

void lmgl::ui::UILoader::set_base_path ( const std::string & base_path)

Set base path for resolving relative paths (fonts, images).

Parameters
base_pathBase directory path.

The documentation for this class was generated from the following files: