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; 
	

你可能感兴趣的:(unreal,engine,unreal4,unreal)