Roblox recently released the GuiService.ViewportDisplaySize API, which is meant to allow developers to programmatically adapt their game’s UIs based on the client’s physical screen size. However, this API isn’t very ideal because it exposes too general information for developers to effectively use.
It would be beneficial for developers aiming to create robust cross-platform games if Roblox exposed more information about the client’s physical viewport display, such as with the already implemented GuiService.ViewportSizeInMM that is currently locked.
The Problem
The way the ViewportDisplaySize is chosen is undocumented, but it is currently based on diagonal screen size in millimeters with the formula Small < 266 < Medium < 685 < Large.
This method has multiple downsides, such bunching 10-inch laptops with 6-inch phones and 26-inch TVs with 16-inch monitors. Developers may also wish to adjust their UIs for more specific form factors like tablets vs phones, but don’t have enough information to do so.
Because of this, it would be better for the actual screen dimensions to be exposed to the developers.
The Proposal
Unlock GuiService.ViewportSizeInMM, which gives the physical dimensions of the viewport in millimeters as a Vector2. The property is already implemented and functions exactly as desired.
There is no reason not to expose this API, as people can continue to use ViewportDisplaySize if they wish, and it allows developers to have more control over what thresholds and form factors their UIs will adapt to.
If Roblox were to add this, I would be able to build more robust cross-compatible UIs in my games.