8#ifndef MALENA_DRAGGABLE_H
9#define MALENA_DRAGGABLE_H
18#include <SFML/Graphics.hpp>
105 std::optional<sf::FloatRect> _dragBounds;
120 bool occurred(
const std::optional<sf::Event>& event)
override;
121 bool filter(
const std::optional<sf::Event>& event,
Core* component)
override;
122 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.
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.
@ DRAGGING
A drag gesture is currently in progress (set by DraggableDispatcher).
Vector2< float > Vector2f