How to get native monitor resolution?

Hi, is there any way to get the native monitor resolution in Blueprints?

1 Like

Hey Stormrage256,

While youā€™re in blueprints, you should be able to use the function ā€œget viewport sizeā€ and itā€™ll receive the size of the monitor. I found a few different links that may help you a bit further:

[AnswerHub Post: Get Screen Resolution][1]
[AnswerHub Post: BP Screen Resolution][2]

Hope this helps! :slight_smile:

Get screen resolution in blueprint or material - Rendering - Epic Developer Community Forums
[2]: How to set screen resolution with Blueprint? - Blueprint - Epic Developer Community Forums

1 Like

Hi , Iā€™ve tried using the ā€˜get viewport sizeā€™, but it gives the resolution at which the game window runs right? I was referring to the native screen resolution of the monitor, so that I can set it as the default resolution when the game starts.

Hey Stormrage256,

Have you tried going into the Editor Preferences, under Level Editor and adjusting the resolution size from the Play tab? You should be able to set it to your native resolution there, and the viewport size within the blueprint should then pull from that.

Thanks!

Hi , the setting in the editor preferences would only work for my system. If I want to run in different systems with different native resolutions, I want to get the native resolution of that system. In the current scenario, it will always launch with the resolution that I specified in the editor.

For example, If I set it to 1080p because thatā€™s my native resolution and then I run on another system that has a native resolution of 1920x1200, setting the value in the editor preferences will try to launch the game at 1080p always.

Hey Stormrage256,

You should be able to go ahead and use the blueprint node called ā€˜get viewport sizeā€™ and itā€™ll provide you with the x and y values on the screen separately.

Cheers!

That is still not an answer to this simple question. Is there a way in UE4 to get the native resolution of the monitor of the end ?

1 Like

Only via C++ using generic platfrom APIs in UE4 which let you get info about platform you running in

https://docs.unrealengine.com/latest/INT/API/Runtime/Core/GenericPlatform/FDisplayMetrics/index.html

In blueprint it seems you only get viewport size

Bump! Anyone figure this out yet or do we need to expose the c++ value into blueprints through a UCLASS?

Yea thatā€™s what Iā€™m doing right now as well.

The best I know is that you can do a GetSupportedFullScreenResolutions to get the list of resolutions the monitor support and usually the last index is the best(highest) resolution for the monitor, not sure if thatā€™s what you want.

Get Game Settings > Get Screen Resolution

That will give you the default resolution.

Get Supported Fullscreen Resolution will get you an array of potential resolutions, from smallest to largest.

for those who are still looking , i found out about a node called " Get desktop resolution "
this getā€™s the resolution at which your desktop is running at , (( it does not get the native resolution of screen ))
because windows allows you to run your system in a lower resolution , it will grap that res for you what ever you have your windows using it will grap it.

2 Likes

This is the solution I am looking for. I have a TV which has a native resolution that runs at 60 Hz and the game looks and plays perfect in this resolution. I still have to assume the users will not change their resolution, but that is on them if they tinker. If I choose the last index though in GetSupportedFullScreenResolutions on this TV, I end up with a better resolution but this runs at 24 Hz causing the game to look and play horribly.

For LCD screens, typically the highest resolution the screen is capable of is the native resolution [My Lowes Life][1].

https://www.myloweslife.vip/

1 Like

Oh my God. You save me!! Thank you so much.