FString screenXY = GEngine->GameViewport->Viewport->GetSizeXY().ToString();
UE_LOG(LogClass, Warning, TEXT("ScreenXY>>>>>>>>%s"), *screenXY);
FVector2D Result = FVector2D( 1, 1 );
if ( GEngine && GEngine->GameViewport )
{
GEngine->GameViewport->GetViewportSize( /*out*/Result );
}
UE_LOG(LogClass, Warning, TEXT("GetViewportSize>>>>>>>>%s"), *Result.ToString());
UE_LOG(LogClass, Warning, TEXT("GetViewportSize>>>>>>>>%d%d"), GSystemResolution.ResX, GSystemResolution.ResY);
//UE_LOG(LogClass, Warning, TEXT("Canvas XY>>>>>>>>%d%d"), Canvas-, Canvas->SizeY);
UE_LOG(LogClass, Warning, TEXT(" UObject::GetWorld()>>>>>>>>%s"), *((GetWorld()->GetGameViewport()->Viewport->GetSizeXY()).ToString()));
Unreal 获取屏幕宽度和高度
最新推荐文章于 2024-12-15 17:41:45 发布