Hi, so my question is how could i make an static resolution for my GUI or even anything? I see that some games have the static resolution for example if you are on fullscreen, then you can see all the GUIS perfectly, and also when you are playing windowed or smaller screen then you can see GUIS perfectly too. But my game doesnt have that function, if i make my game small windowed screen, then i cant see my shop GUI for example. How to get GUIS to scale perfectly on all resolutions basically?
Ever wondered why a 2D Gui has 4 digits
({0, 0}, {0, 0}) to put in? Why not 2(X, Y)? I have the answer to that. Let me explain you why there are 4 instead of 2. So X and Y (both of them) have something called Scale
and Offset
. This is how a normal Size or Position setting would look like:
{0,0},{0,0}
. So basicly there are are 4 digits because X is compose of scale and offset, same thing with Y. Offset is in the right, scale in the left. (X){scale, offset}, (Y){scale, offset}
. So let me take an example: if you set the scale of a frame to {0.5, 0}, {1, 0}, that will be the half of the screen, no matter what device. So it will be the same size for every device, so it will always be the half. But, if you use offset, it would be that amount of pixel for only that device. This might sound confusing, I apologize I am not a very good teacher. I made a GIF which may help you understand this:
https://gyazo.com/adba01315990da0d6282c2adfe4839e8
I am not saying you should only use Scale
, you should use both. Just play around with them and you will understand what I mean.