This strategy partitions the screen into 9 area's that track which Quads are in them, allowing a smaller list of quads to be checked. More...
#include <nineboxstrategy.h>
Public Types | |
typedef std::vector< PartitionData * > | PartitionVec |
Basic container type for PartitionData storage by this class. | |
Public Member Functions | |
NineBoxStrategy () | |
Class constructor. | |
virtual | ~NineBoxStrategy () |
Class destructor. | |
Widget * | FindHoveredWidget (const Vector2 &MousePos) |
Finds the hovered quad for the parent screen. More... | |
Public Member Functions inherited from Mezzanine::UI::MouseHoverStrategy | |
MouseHoverStrategy () | |
Class constructor. | |
virtual | ~MouseHoverStrategy () |
Class destructor. | |
void | _NotifyScreenDirty () |
Notifies this that it's parent screen was altered. More... | |
void | _SetScreen (Screen *Parent) |
Sets the parent screen. More... | |
Protected Member Functions | |
Rect | CalculatePartitionRect (const NineBoxPartition &PartID, const Vector2 &ScreenSize) |
Convenience method for calculating the actual size and position of a single partition. More... | |
PartitionData * | GetHoveredPartition (const Vector2 &MousePos) |
Gets the partition that the provided position is in. More... | |
void | UpdateCache () |
Updates the partition cache with the newest quad positions. | |
Protected Attributes | |
PartitionVec | Partitions |
A container storing all the quads that overlap with this screen partition. | |
Protected Attributes inherited from Mezzanine::UI::MouseHoverStrategy | |
Screen * | ParentScreen |
A pointer to the screen this strategy is being used by. More... | |
bool | ScreenDirty |
Stores whether or not the parent screen has been updated since the last time this strategys cache was updated. More... | |
This strategy partitions the screen into 9 area's that track which Quads are in them, allowing a smaller list of quads to be checked.
Definition at line 100 of file nineboxstrategy.h.
|
protected |
Convenience method for calculating the actual size and position of a single partition.
PartID | The enum value to calculate the pixel size and position for. |
ScreenSize | The current size of the screen the partition is on. |
Returns | a Rect storing the actual size and position of the specified partition. |
Definition at line 132 of file nineboxstrategy.cpp.
Finds the hovered quad for the parent screen.
MousePos | The current mouse position. |
Implements Mezzanine::UI::MouseHoverStrategy.
Definition at line 161 of file nineboxstrategy.cpp.
|
protected |
Gets the partition that the provided position is in.
MousePos | The screen position used to determine which partition to retrieve. |
Definition at line 151 of file nineboxstrategy.cpp.