Unlock GetResolutionScale

As a developer, it is currently impossible to determine the 2D gui scaling factor

Consider a 64x64 image:
image

Using the image as-is

If you use this as-is at 64x64, you get the exact same image on a 1x screen. This is good:
image

But when the screen scales up, shown here at 2x, the image becomes blurry. This is bad.
image

Using a higher-resolution image

If you use a higher resolution image, you get the correct image at the scale you uploaded it at, but higher scales become blurry and lower scales suffer from downsampling artefacts:

Observe how the subtle transitions between light and dark areas become washed out and overall lower-contrast. This also has the obvious issue of loading unnecessarily large images on devices where texture memory may be at a premium.

The solution

It seems to me that the only solution here is to read the gui scaling factor and select the correct image to display. Roblox has an API for this, but it’s locked. So my suggestion is to unlock it.

32 Likes

I actually know someone who ran into this exact issue and wasn’t able to fix it because of it being locked. I 100% agree, the fact that we don’t have access to this in the first place feels pretty random and unneeded

9 Likes

Throwing my support behind this as well. This is more than just benefits for presentational purposes (indeed, I’ve been very bothered about those downsampling artifacts too), but in cases where I’m using lots of sprites, I could cut down on bandwidth usage and load times by loading assets at the lowest resolution needed for the display.

6 Likes

bump!! this is already used in uiblox


ui looks bad on 125% scale (the default for most computers). theres no reason this should be blocked

1 Like