Thanks for this! I thought about how someone could achive that but that solution is more than simple and multipurpose.
When testing it is not working properly for me. Here is my test texture. I checked the calculated image coordinates, looks good. I gues there is an issue with the lookup of the pixel in the texture using the calculated image coordinate. Can someone please check that image on their end?
EDIT:
Solved it for me.
Use this texture to test on your end, should not work.
Change the code to look like this:
FReply OvodusButton::OnMouseMove(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
...
LocalPosition.X *= ImageWidth;
LocalPosition.Y *= AdvancedHitTexture->PlatformData->SizeY;
LocalPosition.X = floor(LocalPosition.X); // ADD THIS LINE
LocalPosition.Y = floor(LocalPosition.Y); // ADD THIS LINE
int BufferPosition = (LocalPosition.Y * ImageWidth) + LocalPosition.X;
FColor* ImageData = static_cast<FColor*>((AdvancedHitTexture->PlatformData->Mips[0]).BulkData.Lock(LOCK_READ_ONLY));
...
}