23#include "guillaume/entities/backdrop.hpp"
27#include "guillaume/systems/backdrop.hpp"
28#include "guillaume/theme.hpp"
32 Backdrop::Backdrop(ecs::ComponentRegistry ®istry)
33 : ecs::EntityFiller<components::Transform, components::Bound,
34 components::Scrim, components::Animation,
39 const auto identifier = getIdentifier();
41 registry.getComponent<components::Bound>(identifier)
44 registry.getComponent<components::Animation>(identifier)
46 .setEasing(theme::MotionScale::enter())
47 .setOnSampleHandler([®istry, identifier](
float progress) {
48 registry.getComponent<components::Backdrop>(identifier)
49 .setProgress(progress);
50 systems::Backdrop::apply(registry, identifier);
52 systems::Backdrop::apply(registry, identifier);
69 float ownerWidth,
float ownerHeight)
72 ownerPose, ownerWidth, ownerHeight);
State of a modal backdrop, the dimming layer behind a dialog or a drawer: whether it is shown and how...
ComponentRegistry & getComponentRegistry(void)
Entity::Identifier getIdentifier(void) const noexcept
Get the identifier of the entity.
The translucent veil painted behind a dialog or a modal drawer to dim the rest of the scene.
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.
void setVisible(bool visible)
Show or hide the backdrop.
static void follow(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, const utility::graphic::PoseF &ownerPose, float ownerWidth, float ownerHeight)
Center a backdrop on its owner and place it half a layer behind it.
static void setVisible(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier, bool visible)
Show or hide a backdrop.
Widgets: the classes used to create entities with the right components and children.
float getMotionDuration(theme::MotionDuration duration)
Get the length the active theme gives to a duration token.