mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-18 16:30:32 +00:00
Added to ImGuiImplementation GetCursorData function allowing to access data associated with ImGui cursors (UVs and size).
This commit is contained in:
parent
cfc76ea286
commit
d152b4193c
@ -28,6 +28,8 @@
|
|||||||
#endif // PLATFORM_WINDOWS
|
#endif // PLATFORM_WINDOWS
|
||||||
|
|
||||||
|
|
||||||
|
#include "ImGuiInteroperability.h"
|
||||||
|
|
||||||
namespace ImGuiImplementation
|
namespace ImGuiImplementation
|
||||||
{
|
{
|
||||||
// This is exposing ImGui default context for the whole module.
|
// This is exposing ImGui default context for the whole module.
|
||||||
@ -41,4 +43,23 @@ namespace ImGuiImplementation
|
|||||||
{
|
{
|
||||||
SaveIniSettingsToDisk(Filename);
|
SaveIniSettingsToDisk(Filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GetCursorData(int CursorType, FVector2D& OutSize, FVector2D& OutUVMin, FVector2D& OutUVMax, FVector2D& OutOutlineUVMin, FVector2D& OutOutlineUVMax)
|
||||||
|
{
|
||||||
|
if (static_cast<unsigned>(CursorType) < static_cast<unsigned>(ImGuiMouseCursor_Count_))
|
||||||
|
{
|
||||||
|
using namespace ImGuiInterops;
|
||||||
|
ImGuiMouseCursorData& CursorData = GImGui->MouseCursorData[CursorType];
|
||||||
|
OutSize = ToVector2D(CursorData.Size);
|
||||||
|
OutUVMin = ToVector2D(CursorData.TexUvMin[0]);
|
||||||
|
OutUVMax = ToVector2D(CursorData.TexUvMax[0]);
|
||||||
|
OutOutlineUVMin = ToVector2D(CursorData.TexUvMin[1]);
|
||||||
|
OutOutlineUVMax = ToVector2D(CursorData.TexUvMax[1]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -13,4 +13,7 @@ namespace ImGuiImplementation
|
|||||||
|
|
||||||
// Save current context settings.
|
// Save current context settings.
|
||||||
void SaveCurrentContextIniSettings(const char* Filename);
|
void SaveCurrentContextIniSettings(const char* Filename);
|
||||||
|
|
||||||
|
// Get specific cursor data.
|
||||||
|
bool GetCursorData(int CursorType, FVector2D& OutSize, FVector2D& OutUVMin, FVector2D& OutUVMax, FVector2D& OutOutlineUVMin, FVector2D& OutOutlineUVMax);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user