I am trying to set up a 2D vector environment, so that it looks like this
now to achieve this, I need to normalize the distance/size of my computer screen. If my monitor size is 1024 x 1024 Pixels, how can I turn that into a normalized 10x10 unit? What if the screen isn’t a perfect square?
Essentially, what I want is to get some sort of 10x10 or 100x100 2d environment based on my screen size.
I’ve thought of using math.clamp() to normalize the distance, but I’ve no clue how to deal with the screen being a rectangle.
I achieved the goal, here’s the finished product!
In the end I didn’t have to use clamp() all that much, most of it was creating the functions to convert a vector2(given in units) to udim, and a function to convert udim into vector2. It turned out pretty well! The 2D vector can be set to whichever unit system you like, such as 4x4 or 1000x1000