guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::components::Backdrop Class Reference

State of a modal backdrop, the dimming layer behind a dialog or a drawer: whether it is shown and how far its fade-in has progressed. More...

#include <headers/guillaume/components/backdrop.hpp>

Inheritance diagram for guillaume::components::Backdrop:
Collaboration diagram for guillaume::components::Backdrop:

Public Member Functions

 Backdrop (void)=default
 Default constructor.
 ~Backdrop (void)=default
 Default destructor.
bool isVisible (void) const
 Check whether the backdrop is shown.
Backdrop & setVisible (bool visible)
 Store whether the backdrop is shown.
float getProgress (void) const
 Get the fade-in progress.
Backdrop & setProgress (float progress)
 Set the fade-in progress. Called by the entity's fade animation on every sample.
Public Member Functions inherited from guillaume::ecs::Component
bool hasChanged (void) const
 Tell whether a value of the component changed since the flags were last reset (the end of the previous frame).
void setHasChanged (bool hasChanged)
 Raise or lower the changed flag.
 Component (void)=default
 Create a component that is not marked as changed.
virtual ~Component (void)=default
 Virtual destructor, so components can be destroyed through the base class.

Detailed Description

State of a modal backdrop, the dimming layer behind a dialog or a drawer: whether it is shown and how far its fade-in has progressed.

Written through systems::Backdrop::setVisible, which also starts the entity's components::Animation; that animation writes the progress while it plays. systems::Backdrop reads the state in the Layout phase and writes the color of the entity's components::Scrim: the theme's backdrop color with its alpha multiplied by the progress, or fully transparent while hidden.

systems::Backdrop::setVisible(registry, backdropId, true);
static void setVisible(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, bool visible)
Show or hide a backdrop.
Definition backdrop.cpp:55
Note
Prefer systems::Backdrop::setVisible to the setters of this class: setVisible() here stores the flag only, it neither resets the progress nor starts the fade.
See also
systems::Backdrop, components::Scrim, entities::Backdrop

Definition at line 51 of file backdrop.hpp.

Member Function Documentation

◆ getProgress()

float guillaume::components::Backdrop::getProgress ( void ) const

Get the fade-in progress.

Returns
0 (the default) for a transparent backdrop, 1 for the full backdrop color.

Definition at line 42 of file backdrop.cpp.

◆ isVisible()

bool guillaume::components::Backdrop::isVisible ( void ) const

Check whether the backdrop is shown.

Returns
True when shown; false (the default) when hidden, in which case the scrim is transparent whatever the progress.

Definition at line 27 of file backdrop.cpp.

◆ setProgress()

Backdrop & guillaume::components::Backdrop::setProgress ( float progress)

Set the fade-in progress. Called by the entity's fade animation on every sample.

Marks the component changed only when the value differs.

Parameters
progressThe progress, from 0 (transparent) to 1 (full backdrop color). The value is stored as given, not clamped.
Returns
This component, for chaining.

Definition at line 47 of file backdrop.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVisible()

Backdrop & guillaume::components::Backdrop::setVisible ( bool visible)

Store whether the backdrop is shown.

Marks the component changed only when the value differs. The scrim color follows the next time systems::Backdrop runs.

Parameters
visibleTrue to show the backdrop, false to hide it.
Returns
This component, for chaining.

Definition at line 32 of file backdrop.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

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