| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #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;
- };
- }
|