So I have been working on this inventory which consists of a scrolling frame, and I wanted the canvas size to be exactly as how many weapons there are, So I tried scripting that cause I cannot get it that perfect. It did not work as I used scale which in the end makes the tiles become out of place in size. But it would work in offset but it won’t be perfect for all resolutions.
So can someone answer with the formula of converting offset into scale? So that I could set everything into offset when the weapons aren’t loaded, and when they load, I could convert them to scale so they fit all resolutions.
Well using ratio you will know that scale being 1 = the whole length so predicting you have a 1920 x1080 display you get this
X: 1:1920
Y: 1:1080
So basically get the y resolution and divide your pixels by itself
Eg
local xreso = 1080
local pixelstoscale = 540
print(1 / (xreso / pixelstoscale))