#pragma once #include "BsEditorPrerequisites.h" #include "BsGUIElementContainer.h" namespace BansheeEngine { /** * Helper class used for detecting when mousing over a certain * and getting notified when that state changes. */ class BS_ED_EXPORT GUIHoverHitBox : public GUIElementContainer { public: /** * Returns type name of the GUI element used for finding GUI element styles. */ static const String& getGUITypeName(); /** * Creates a new hover hit box that will detect mouse hover/out events over certain area. */ static GUIHoverHitBox* create(); /** * Creates a new hover hit box that will detect mouse hover/out events over certain area. */ static GUIHoverHitBox* create(const GUIOptions& options); /** * @brief Triggered when pointer hovers over the hit box. */ Event onHover; /** * @brief Triggered when pointer that was previously hovering leaves the hit box. */ Event onOut; private: GUIHoverHitBox(const GUIDimensions& dimensions); /** * @copydoc GUIElementContainer::updateClippedBounds */ void updateClippedBounds() override; /** * @copydoc GUIElementContainer::_mouseEvent */ virtual bool _mouseEvent(const GUIMouseEvent& ev) override; }; }