Let developers query resolution scale / high dpi

As a Roblox developer, it is currently too hard to know if a user is playing our games using a device with a high DPI screen or not. After doing some digging, it seems like Roblox already provides an API for this (?)

However, that API member has been locked down for use only in core scripts.
Some use cases for querying this API would be:

  • Dynamically choosing what image assets to use in code, based on the dpi settings of the device. I understand Roblox would like this process to be completely transparent and automatic, but having more control over the process as a developer would be great. The open-source project tarmac, which is available under Roblox’s own github organization, has an example of this method being used.

  • Implementing a queue system for high dpi assets in a game, to preload more contextually important assets such as a high resolution minimap image before a button image that is buried in a settings menu.

  • Better player device analytics. It would be easier to determine what percentage of a games userbase has high resolution screens, and distribute design / development time towards that accordingly.

24 Likes

to preload more contextually important assets such as a high resolution minimap image before a button image that is buried in a settings menu.

Why not always preload the buried settings menu button last, regardless of DPI?

1 Like

The example was meant to be more about preloading higher resolution versions of an asset when it is needed, while also being based on gameplay & context. Something like this:

  1. Load low-res minimap
  2. Load low-res button
  3. Check if the player has a high DPI screen? meaning an image sized at 128px in a script will actually render at 256px and we need higher res assets
  4. Load high-res minimap and replace the original
  5. Load high-res button and replace the original
2 Likes

big bump. i really REALLY REALLY need this
i’m surprised roblox does not let us use much needed ui tools like this one

1 Like

hellooooo new year new bump
still surprised that this api hasnt been released to the public yet :sob:

3 Likes

Bump if youre not gonna add svg support please add this

2 Likes

The “alternative” to this (querying AbsoluteSize of a fullscreen frame) doesn’t work until the loading screen has vanished! It returns 800x600 no matter what (During my testing in studio) and I can’t even wait for this to change because anyone with an 800x600 resolution monitor wouldn’t be able to play my game