|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures Image widgets and registers them in the scene's entity registry. More...
#include <headers/guillaume/entities/image.hpp>


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder holding the defaults of reset(). | |
| std::shared_ptr< Image > | buildEntity (void) override |
| Build an image from the current configuration, without registering it or giving it a parent. | |
| void | reset (void) override |
| Restore the defaults: empty texture path, no fallback texture, and no size (width and height 0). | |
| Builder & | withTexturePath (const std::string &texturePath) |
| Choose the texture to draw. | |
| Builder & | withFallbackPath (const std::string &fallbackPath) |
| Set the texture drawn when the main one fails to load. | |
| Builder & | withSize (float width, float height) |
| Set the displayed size. | |
| std::shared_ptr< Image > | makeImage (std::shared_ptr< Entity > parent, const std::string &texturePath) |
| Build an image, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Image > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< Image > | registerEntity (std::shared_ptr< ecs::Entity > parent) |
| Build the widget, attach it to its parent, hand it to the entity registry, then reset the builder to its defaults. | |
| Public Member Functions inherited from guillaume::ecs::EntityBuilder | |
| EntityBuilder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder working on a pair of registries, normally those of one scene. | |
| virtual | ~EntityBuilder (void)=default |
| Virtual destructor. | |
Additional Inherited Members | |
| Protected Member Functions inherited from guillaume::ecs::EntityBuilder | |
| ComponentRegistry & | getComponentRegistry (void) |
| Get the registry in which the builder creates components. | |
| EntityRegistry & | getEntityRegistry (void) |
| Get the registry in which the builder registers the entities it creates. | |
Configures Image widgets and registers them in the scene's entity registry.
| guillaume::entities::Image::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
|
overridevirtual |
Build an image from the current configuration, without registering it or giving it a parent.
The size is applied only when both the width and the height are positive.
Implements guillaume::entities::EntityBuilderBase< Image >.
Definition at line 39 of file image.cpp.


| std::shared_ptr< Image > guillaume::entities::Image::Builder::makeImage | ( | std::shared_ptr< Entity > | parent, |
| const std::string & | texturePath ) |
Build an image, register it under parent and reset the builder.
The fallback path and size set with the with... methods apply to the built image.
| parent | The entity the image is attached to, or nullptr for a root entity. |
| texturePath | The path of the texture file to draw. |
Definition at line 80 of file image.cpp.


|
overridevirtual |
Restore the defaults: empty texture path, no fallback texture, and no size (width and height 0).
Implements guillaume::ecs::EntityBuilder.
Definition at line 50 of file image.cpp.


| Image::Builder & guillaume::entities::Image::Builder::withFallbackPath | ( | const std::string & | fallbackPath | ) |
Set the texture drawn when the main one fails to load.
| fallbackPath | The path of the fallback texture file. Empty by default, which means no fallback. |
Definition at line 59 of file image.cpp.


| Image::Builder & guillaume::entities::Image::Builder::withSize | ( | float | width, |
| float | height ) |
Set the displayed size.
Unlike Image::setSize(), this never throws: the built image keeps the Bound it was created with unless both values are positive.
| width | The displayed width, in dp. 0 by default. |
| height | The displayed height, in dp. 0 by default. |
Definition at line 65 of file image.cpp.


| Image::Builder & guillaume::entities::Image::Builder::withTexturePath | ( | const std::string & | texturePath | ) |
Choose the texture to draw.
| texturePath | The path of the texture file, as the resource provider of the application resolves it. Empty by default. |
Definition at line 73 of file image.cpp.

