unreal engine 获取鼠标在UMG上的坐标
·
float mouseLocationX = 0.0f;
float mouseLocationY = 0.0f;
if (controller)
{
controller->GetMousePosition(mouseLocationX, mouseLocationY);
}
float viewportScale = UWidgetLayoutLibrary::GetViewportScale(GetWorld());
FVector2D viewportPos = FVector2D(mouseLocationX, mouseLocationY) / viewportScale;
更多推荐
所有评论(0)