|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
The translucent veil painted behind a dialog or a modal drawer to dim the rest of the scene. More...
#include <headers/guillaume/entities/backdrop.hpp>


Public Member Functions | |
| ~Backdrop (void) override=default | |
| Destructor. | |
| void | setVisible (bool visible) |
| Show or hide the backdrop. | |
| bool | isVisible (void) const |
| Check whether the backdrop is shown. | |
| void | follow (const utility::graphic::PoseF &ownerPose, float ownerWidth, float ownerHeight) |
| Centre the backdrop on its owner, half a layer behind it. | |
| Public Member Functions inherited from guillaume::ecs::EntityFiller< components::Transform, components::Bound, components::Scrim, components::Animation, components::Backdrop > | |
| EntityFiller (ComponentRegistry &componentRegistry) | |
| Create the entity, its listed components and its components::Hierarchy. | |
| virtual | ~EntityFiller (void)=default |
| Destroy the entity object; its components stay in the registry (see EntityRegistry::removeEntity). | |
| Public Member Functions inherited from guillaume::ecs::Entity | |
| Entity (void) | |
| Create an entity with a fresh identifier, an empty signature, no parent and no component. | |
| virtual | ~Entity (void)=default |
| Destroy the entity object. | |
| Entity::Identifier | getIdentifier (void) const noexcept |
| Get the identifier of the entity. | |
| Entity::Signature | getSignature (void) const noexcept |
| Get the set of component types the entity declares. | |
| void | setSignature (const Signature &signature) |
| Replace the signature of the entity. | |
| std::int32_t | getLayer (void) const noexcept |
| Get the depth of the entity in the tree. | |
| Entity & | setParent (std::shared_ptr< Entity > parent) |
| Attach the entity under another one, or detach it. | |
| std::vector< Identifier > | releaseComponents (void) |
| Drop the entity's place in the tree and all its components. | |
| std::shared_ptr< Entity > | getParent (void) const noexcept |
| Get the parent entity. | |
Static Public Member Functions | |
| template<typename... Arguments> | |
| static std::shared_ptr< Backdrop > | create (Arguments &&...arguments) |
| Build a hidden backdrop without registering it in an entity registry. | |
| Static Public Member Functions inherited from guillaume::ecs::Entity | |
| template<InheritFromComponent... ComponentTypes> | |
| static Signature | getSignatureFromTypes (void) |
| Build the signature that has exactly the bits of the given component types. | |
Static Public Attributes | |
| static constexpr float | Extent = systems::Backdrop::Extent |
| Side of the backdrop quad, in dp. | |
| Static Public Attributes inherited from guillaume::ecs::Entity | |
| static constexpr Identifier | InvalidIdentifier |
| "No entity": never the identifier of a real entity | |
Additional Inherited Members | |
| Public Types inherited from guillaume::ecs::Entity | |
| using | Identifier = std::size_t |
| The key under which an entity's components are stored. Systems and components refer to entities by this value. | |
| using | Signature = std::bitset<128> |
| A set of component types, one bit per type (bit position given by ComponentTypeId, MaxComponentTypes bits). | |
| Protected Member Functions inherited from guillaume::ecs::EntityFiller< components::Transform, components::Bound, components::Scrim, components::Animation, components::Backdrop > | |
| ComponentRegistry & | getComponentRegistry (void) |
| Get the registry that stores this entity's components. | |
| Protected Member Functions inherited from guillaume::ecs::Entity | |
| void | attachHierarchy (ComponentRegistry &componentRegistry) |
| Give the entity a components::Hierarchy in a registry and add that component to its signature. | |
| template<InheritFromComponent... ComponentTypes> | |
| void | setSignature (void) |
| Replace the signature by the one made of the given component types. | |
The translucent veil painted behind a dialog or a modal drawer to dim the rest of the scene.
Backdrop is a leaf widget: it has no children. Its state lives in components::Backdrop (visibility and fade-in progress); systems::Backdrop turns it into the color of components::Scrim each frame, in the Layout phase, and systems::ScrimRender draws the quad. components::Animation drives the fade-in: it lasts the Medium2 motion duration of the theme, with the enter easing. The class itself holds no field.
Applications rarely create one: Dialog and NavigationDrawer each build their own backdrop, and their systems show, hide and place it every frame. Backdrop has no Builder; Backdrop::create(registry) is the only way to build one.
Watch out:
Definition at line 78 of file backdrop.hpp.
|
inlinestatic |
Build a hidden backdrop without registering it in an entity registry.
The arguments are forwarded to the private constructor: (registry). A backdrop has no children to build.
| Arguments | The constructor argument types. |
| arguments | The constructor arguments, as listed above. |
Definition at line 100 of file backdrop.hpp.
| void guillaume::entities::Backdrop::follow | ( | const utility::graphic::PoseF & | ownerPose, |
| float | ownerWidth, | ||
| float | ownerHeight ) |
Centre the backdrop on its owner, half a layer behind it.
Writes the pose of components::Transform once; the backdrop does not track the owner afterwards.
| ownerPose | The pose of the owner (its top-left corner). The backdrop takes its orientation. |
| ownerWidth | The width of the owner, in dp. |
| ownerHeight | The height of the owner, in dp. |
Definition at line 68 of file backdrop.cpp.


| bool guillaume::entities::Backdrop::isVisible | ( | void | ) | const |
Check whether the backdrop is shown.
Definition at line 61 of file backdrop.cpp.


| void guillaume::entities::Backdrop::setVisible | ( | bool | visible | ) |
Show or hide the backdrop.
Showing restarts the fade-in from transparent. Hiding stops the animation and makes the backdrop transparent at once. The Scrim color is updated before the call returns. Passing the current visibility does nothing.
| visible | True to show the backdrop, false to hide it. |
Definition at line 55 of file backdrop.cpp.


|
staticconstexpr |
Side of the backdrop quad, in dp.
Definition at line 87 of file backdrop.hpp.