101 std::optional<sf::FloatRect> _dragBounds;
116 bool occurred(
const std::optional<sf::Event>& event)
override;
117 bool filter(
const std::optional<sf::Event>& event,
Core* component)
override;
118 void fire(
const std::optional<sf::Event>& event)
override;
#define ML_EXPORT(ClassName)
Register a Malena type with the framework.
Virtual base class for all Malena framework objects.
Dispatcher singleton for drag events.
bool occurred(const std::optional< sf::Event > &event) override
Return true when the incoming SFML event should trigger this dispatcher.
bool filter(const std::optional< sf::Event > &event, Core *component) override
void fire(const std::optional< sf::Event > &event) override
Deliver this event to all matching registered components.
friend class DraggableDispatcher
virtual ~Draggable()=default
void setDragBounds(const sf::FloatRect &bounds)
Constrain drag movement to an axis-aligned bounding rectangle.
DraggableManifest::Flag Flag
DraggableManifest::State State
void clearDragBounds()
Remove any previously set drag bounds.
Manifest for the Draggable trait.
@ LOCK_X
Lock horizontal — drag Y axis only.
@ FREE
Drag freely on both axes (default).
@ LOCK_Y
Lock vertical — drag X axis only.
@ DRAGGING
Set while the user is actively dragging.
Base class for all per-event dispatchers in the Malena event system.
Base class for all event-receiving traits.
Base class for all Malena manifests.
Vector2< float > Vector2f