Getting viewport (screen?) size in editor (not in play mode)

Posting my solution here in case somebody will need it:

if (FViewport* Viewport = GEditor->GetActiveViewport())
	{
		return Viewport->GetSizeXY();
	}

Also, don’t forget to add a “UnrealEd” module in your Build.cs script

2 Likes