8#ifndef MALENA_HOVERABLE_H
9#define MALENA_HOVERABLE_H
56 void onHover(std::function<
void()> callback,
bool overwrite =
true);
65 void onHover(std::function<
void(
const std::optional<sf::Event>& event)> callback,
bool overwrite =
true);
74 void onUnhover(std::function<
void()> callback,
bool overwrite =
true);
83 void onUnhover(std::function<
void(
const std::optional<sf::Event>& event)> callback,
bool overwrite =
true);
90 bool occurred(
const std::optional<sf::Event>& event)
override;
91 bool filter(
const std::optional<sf::Event>& event,
Core* component)
override;
92 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.
Base class for all per-event dispatchers in the Malena event system.
Base class for all event-receiving traits.
Trait that adds mouse-hover and mouse-leave callbacks to any Core object.
void onUnhover(std::function< void(const std::optional< sf::Event > &event)> callback, bool overwrite=true)
Register a callback invoked when the mouse leaves this component's bounds, receiving the raw SFML eve...
void onHover(std::function< void(const std::optional< sf::Event > &event)> callback, bool overwrite=true)
Register a callback invoked when the mouse enters this component's bounds, receiving the raw SFML eve...
void onHover(std::function< void()> callback, bool overwrite=true)
Register a no-argument callback invoked when the mouse enters this component's bounds.
void onUnhover(std::function< void()> callback, bool overwrite=true)
Register a no-argument callback invoked when the mouse leaves this component's bounds.