27#include <utility/graphic/size.hpp>
29#include "guillaume/ecs/component.hpp"
62 std::function<void(
void)>;
64 std::function<void(
void)>;
69 bool _isHovered {
false };
70 utility::graphic::SizeUI _accessibilityMargin {
HoverHandler getOnHoverHandler(void) const
Get the callback run when the hand ray enters the entity.
HandHoverInteraction & setAccessibilityMargin(const utility::graphic::SizeUI &margin)
Grow the hit area past the entity's bound without growing the entity on screen.
HandHoverInteraction & setOnUnhoverHandler(const UnhoverHandler &handler)
Store the callback run when the hand ray leaves the entity.
HandHoverInteraction & setHovered(bool isHovered)
Record whether a hand aims at the entity.
HandHoverInteraction & setOnHoverHandler(const HoverHandler &handler)
Store the callback run when the hand ray enters the entity.
std::function< void(void)> UnhoverHandler
Called on hover end.
UnhoverHandler getOnUnhoverHandler(void) const
Get the callback run when the hand ray leaves the entity.
~HandHoverInteraction(void)=default
Default destructor.
HandHoverInteraction(void)
Construct a component that is not hovered, has no handler and no margin.
std::function< void(void)> HoverHandler
Called on hover start.
utility::graphic::SizeUI getAccessibilityMargin(void) const
Get the hit area added around the entity's bound.
bool isHovered(void) const
Check whether a hand aims at the entity.
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
State. Every class here is plain data attached to an entity.