I would like to scale up a number to always be the same percentage of a bigger number, if you get what I mean.
I am making a start screen for my game, and basically I need the buttons to always be the same no matter what size the user has.
So for example, if 250 looks correct with a screen size of 500, what is the maths to make it scale to being the same relative size to the screen size before?
Yes, my example of 250 is really easy because it is just screenSize/2, but if it is something like 364, then it is not so easy, which is why I would like to know.
Thanks!
I'm not entirely sure whether this is correct, but here goes.
If $a$ out of $b$ is the correct proportion, and now you want to get value for new screen size $c$, then the correct size will be $\dfrac{a}{b}\times c$. You can round off to nearest integer if the value doesn't turn out to be an integer.
For example, if $364$ out of $500$ is the correct proportion, and new screen size is $700$, then the new 'correct' size of button is $\dfrac{364}{500}\times 700 = 509.6 \simeq 510$.
Hope this helps.