UI not scaling properly

How do I…

I want the UI to scale properly but for whatever reason the lower the resolution of the window goes the more it stops working

What is the expected result

The stamina bar (green) should be perfectly aligned with the hotbar, same goes for the 2 other bars.

What is the actual result

The lower the resolution the smaller the height of the bars gets + they start creating space between eachother

Related screenshots

1080x


720x

108x

(of course the last screenshot is extremely low resolution but its just to show that the staminabar, healthbar and hungerbar dont scale properly)

i dont think theres anything wrong with the events


i checked using ctrl + f if theres any event that overrides the staminabar scale but there isnt? soo im not really sure whats causing it :expressionless:

Other than heaLthbar is named heathbar
I can’t see anything wrong

I doubt it will have any difference but i would try CameraHeight and Width

Your first 2 screen shots suggest your bar images have a row of transparent pixels along the top and bottom rows of the image. If this is so, then as the resolution decreases this border size relative to the bar will appear to increase. It’s only because of the space pixels take up ion lower resolutions.

As such, there isn’t anything you can do about it - it’s all dependent on the resolution. 1 pixels in 360x has the same screen size as 2 pixels in 720x and about 4 pixels in 1080x.


idk why the first screenshot was like that. usually 1920x1080 doesnt have the space but ye

okay. ill reply with update once i test



bottom is camera width + height, and top is window width + height… weird

disabling resizing of the screen makes the window size exact… im not really sure why the camera keeps changing values so much? (i even had to round it to 2 decimal places or whatever its called in english)

I always use camera instead of screen
I do not remember why exactly but i remember once screen was giving me some issue

Anyway did you fix it or no?

1 Like

sorry for now replying… i was fixing some other stuff in the game.


(640x360. red line is about where the middle is)

i replaced a with CameraWidth("UI", )
image
simple stuff like crosshair works but going under 1280x720 probably starts skipping pixels or something resulting in gaps and stuff i guess

ill reply with update once i get everything working

(i was only playing around with the staminabar, hotbar, and font size that why the other stuff is still broken)

the events:

1920x1080

1280x720

640x360

not like anyone is going to be playing below 720p but im just wondering if i did something wrong and im just stupid or if the problem is something else.

i guess this is alright enough but ye


this makes no sense at all lol