Hello guys,
I’m currently working on a selection box/marquee selection like those seen in RTS games
So I think for the first step, I would have to get the mouse coordinate on where the drawing of the box will begin and ends
I need some help and guidance on how to print out the value of the X and Y coordinates to show that its running fine.
Do i have to modify this line of code in any particular way?
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, TEXT("Is this running?"));
Here are the rest of the codes
bool ARTS_RealPlayerController::GetMouseScreenPosition(FVector2D& MousePosition)
{
#if PLATFORM_DESKTOP
const ULocalPlayer* LocalPlayer = Cast(Player);
if (LocalPlayer && LocalPlayer->ViewportClient)
{
MousePosition = LocalPlayer->ViewportClient->GetMousePosition();
return true;
}
#endif
return false;
}
void ARTS_RealPlayerController::GetMouseCoordinate()
{
FVector2D MousePos;
FVector2D MousePosition;
GetMouseScreenPosition(MousePosition);
MousePos.X = MousePosition.X;
MousePos.Y = MousePosition.Y;
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, TEXT("Is this running?"));
}
Thanks