| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #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<void()> onHover;
- /**
- * @brief Triggered when pointer that was previously hovering leaves the hit box.
- */
- Event<void()> onOut;
- private:
- GUIHoverHitBox(const GUIDimensions& dimensions);
- /**
- * @copydoc GUIElementContainer::updateClippedBounds
- */
- void updateClippedBounds() override;
- /**
- * @copydoc GUIElementContainer::_mouseEvent
- */
- virtual bool _mouseEvent(const GUIMouseEvent& ev) override;
- };
- }
|