This object class helps initialize GUI components for the CCanvas from files and data.The CGUIImporter class helps load, import, and initialize GUI components for a CCanvas, from .gui files or serializable data, typically exported by CGUIExporter or designed in the Skylicht-Editor.
More...
#include <Graphics2D/CGUIImporter.h>
|
|
static bool | loadGUI (const char *file, CCanvas *canvas) |
| static bool | beginImport (const char *file, CCanvas *canvas) |
| | Begin importing a GUI layout from file. Initializes structures for step-based loading.
|
| static bool | updateLoadGUI () |
| | Perform one step in the GUI loading process. Used for asynchronous or progressive loading.
|
| static float | getLoadingPercent () |
| | Get percent progress of the GUI loading process.
|
| static CObjectSerializable * | loadGUIToSerializable (const char *file, CCanvas *canvas) |
| | Load a GUI layout from file into a serializable object structure.
|
| static void | loadGUIFromSerializable (CObjectSerializable *gui, CCanvas *canvas) |
| | Initialize a canvas from a serializable GUI object.
|
| static CGUIElement * | importGUI (CCanvas *canvas, CGUIElement *target, CObjectSerializable *obj, bool generateNewId=false) |
| | Import a GUI element tree from a serializable object into the canvas.
|
| static CObjectSerializable * | getSerializableByPath (CObjectSerializable *obj, const char *path) |
| | Find a serializable GUI object by its path in the hierarchy.
|
| static void | reset (CCanvas *canvas) |
| | Reset the canvas to default state after import (position, size, background color).
|
This object class helps initialize GUI components for the CCanvas from files and data.
The CGUIImporter class helps load, import, and initialize GUI components for a CCanvas, from .gui files or serializable data, typically exported by CGUIExporter or designed in the Skylicht-Editor.
- See also
- CCanvas
float applyScale = 0.0f;
CGUIImporter::loadGUI("menu.gui", canvas);
This class manages GUI components, including creating and deleting images and sprites.
Definition CCanvas.h:79
void updateEntities()
Update internal entity lists and sorting for rendering.
void applyGUIScale(float widthOrHeight=1.0f)
Apply GUI scaling based on width or height ratio.
This object class stores information for a GameObject.
Definition CGameObject.h:52
It's the primary container object for the CScene; all CGameObject have a CZone as their root parent.
Definition CZone.h:37
All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees a...
Definition CIndexBuffer.h:13
◆ beginImport()
| bool Skylicht::CGUIImporter::beginImport |
( |
const char * | file, |
|
|
CCanvas * | canvas ) |
|
static |
Begin importing a GUI layout from file. Initializes structures for step-based loading.
- Parameters
-
| file | Path to the .gui file. |
| canvas | Pointer to the CCanvas to initialize. |
- Returns
- True if initialization was successful.
◆ buildCanvas()
Build the initial canvas structure from XML reader.
- Parameters
-
| canvas | Pointer to CCanvas. |
| reader | XML reader. |
◆ getLoadingPercent()
| float Skylicht::CGUIImporter::getLoadingPercent |
( |
| ) |
|
|
static |
Get percent progress of the GUI loading process.
- Returns
- Loading progress as a value between 0.0 and 1.0.
◆ getSerializableByPath()
Find a serializable GUI object by its path in the hierarchy.
- Parameters
-
| obj | Root serializable object. |
| path | Path string (separated by / or ). |
- Returns
- Pointer to found CObjectSerializable, or NULL.
◆ importGUI()
Import a GUI element tree from a serializable object into the canvas.
- Parameters
-
| canvas | Pointer to CCanvas. |
| target | Parent GUI element. |
| obj | Serializable object for element. |
| generateNewId | If true, assigns new IDs to elements. |
- Returns
- Pointer to imported CGUIElement.
◆ loadGUIFromSerializable()
Initialize a canvas from a serializable GUI object.
- Parameters
-
| gui | Pointer to root serializable object. |
| canvas | Pointer to CCanvas to initialize. |
◆ loadGUIToSerializable()
Load a GUI layout from file into a serializable object structure.
- Parameters
-
| file | Path to the .gui file. |
| canvas | Pointer to CCanvas (for context). |
- Returns
- Pointer to the loaded CObjectSerializable (must be deleted by caller).
◆ loadObjChilds()
Load all children for a serializable object from XML reader.
- Parameters
-
| obj | Serializable object. |
| canvas | Pointer to CCanvas. |
| reader | XML reader. |
- Returns
- True if loading is finished.
◆ loadObjStep()
Internal loading step for a serializable object from XML reader.
- Parameters
-
| obj | Serializable object. |
| canvas | Pointer to CCanvas. |
| reader | XML reader. |
- Returns
- True if loading is finished.
◆ loadStep()
Internal loading step for canvas from XML reader.
- Parameters
-
| canvas | Pointer to CCanvas. |
| reader | XML reader. |
- Returns
- True if loading is finished.
◆ reset()
| void Skylicht::CGUIImporter::reset |
( |
CCanvas * | canvas | ) |
|
|
static |
Reset the canvas to default state after import (position, size, background color).
- Parameters
-
| canvas | Pointer to canvas to reset. |
◆ updateLoadGUI()
| bool Skylicht::CGUIImporter::updateLoadGUI |
( |
| ) |
|
|
static |
Perform one step in the GUI loading process. Used for asynchronous or progressive loading.
- Returns
- True if loading is finished.
The documentation for this class was generated from the following file: