Season 1 Episode 3
What is SMART?
This is a new series that I am starting, which will help smooth out your workflow, drive traffic to your game, and build your audience much faster. All parts of this series will be useful to your goals and will help you work faster and more easily.
What is this formula?
Have you ever gotten into the problem where you’re trying to get the UICorner ratios the same in comparison to other frames? Well, look no further because this formula is here to save the day. With this formula, you can easily make simple and fast changes to UICorners to make them equal to each other, even if they are different sizes and scale ratios!
The problem
Say you’ve been given three frames that you are to make rounded the exact same, so you try to do that by giving them all a UICorner and setting their CornerRadius value to 0.3, 0.
Then you look at this image and think, “How in the world could this be wrong? They are all equal?” Well, this is because they have a different size ratio,s which makes it very annoying to design. Though it is possible, so let’s make them equal, shall we?
The formula
First off, let:
There isn’t a single universal formula for this problem because, sadly, not every screen resolution is 16:9. Some are 9:16, or maybe some people are playing on a refrigerator, I mean, who knows.
There are multiple formulas that all need to be taken into account.
This formula is most useful for when you are looking for the most consistent UI Corners, and when you want them to be consistent across all sizes.
This formula will only work on 1 screen ratio, and that is the one that you set. Can be changed by making the same formula multiple times for all different screen types.
If you don’t want to keep your players guessing on their screen ratio, then this is a good second option. Use this formula when you want to have a decent middle ground for most screen layouts.
This formula is highly prone to distortion on extreme aspect ratios, mostly seen in elements that are abnormally wide or tall. This is not an ideal formula for highly rounded elements.
This formula is better for when you are looking to get responsiveness from your UICorners. This formula is more sensitive towards smaller dimensions and is most useful for more circular images.
This formula is a little more advanced than the others, though it is still less intuitive than most of them. This may cause slight distortion on very narrow or tall elements.
This formula is the simplest of the bunch, but it is decent if you’re looking for a fast and reliable formula that doesn’t rely on any external information such as the screen resolution.
This formula is simple, which makes it a little conservative on rounding. This issue may lead to less smooth or overly subtle changes to the rounding. Not recommended for all use cases.
So all in all, this is the final table comparing all of the formulas.
| Formula | Effectiveness | Grade | Best Use Case |
|---|---|---|---|
| 1 | 95/100 | A | Most accurate when screen ratio is available |
| 2 | 85/100 | B | Balanced rounding for general-purpose UIs |
| 3 | 83/100 | B− | Smooth feel for frames with varying dimensions |
| 4 | 70/100 | C− | Safe fallback, simple, works in all cases |
Please don’t use a formula based solely on its grade here; please read the formula’s description to find what use case works best for you.
Example
Alright, so now you’re ready to start making some rounded corners, you’ve done your research and found the best formula was Formula 1. So, now we can find the best rounding scale for each of the frames in our picture above so that they all match the square frame’s scale ratio.
First things first, we need to get all of our values:
sx, sy = Base frame scale X and Y
R = Screen aspect ratio (Height / Width)
C = Constant that is based on the square's target rounding
Then we say that we want all of our frames to have the same rounding scale as the square frame on the far left of our image. So:
We start by defining all our variables:
First, we take the data we need from our target frame (square frame):
Size: {0.14, 0},{0.234, 0};
CornerRadius: 0.3, 0
Then, we only need one more data point, which is our screen resolution:
ScreenWidth = 1920
ScreenHeight = 1080
Then we define our first two variables (sx and sy):
sx = The X value of our target frame, which is (0.140, 0)
sy = The Y value of our target frame, which is (0.234, 0)
Then we can define our next variable (R)
R = The screen height / the screen width, which is 1080 / 1920. Which can be simplified down to 0.5625
Then we can find C from our variables and solve for the square frame:
We can take our first part of the equation:
min(sx, sy * r)
Then we can plug in the values we found in “defining our variables”:
min(0.14, 0.234 * 0.5625)
Then we can simplify this equation to get:
min(0.14, 0.131625)
Then we take the smaller number and multiply it by our CornerRadius:
0.131625 * 0.3
To get a final answer of:
0.0394875
Next, we can solve for the tall frame:
First, we find our sx and sy values for the tall frame:
sx = 0.14, 0
sy = 0.72, 0
Next, we can take our first part of the equation:
min(sx, sy * r)
Then we can plug in the values we found in the first step:
min(0.14, 0.72 * 0.5625)
Then we can simplify this equation to get:
min(0.14, 0.405)
Then we can take out the smaller number:
0.14
Then, with our smaller number, we can take C and divide it by our new number:
C/0.14
We can then add in the value of C:
0.0394875/0.14
To get a final answer of:
0.2821
Lastly, we can solve for the wide frame:
First, we find our sx and sy values for the wide frame:
sx = 0.382, 0
sy = 0.101, 0
Next, we can take our first part of the equation:
min(sx, sy * r)
Then we can plug in the values we found in the first step:
min(0.382, 0.101 * 0.5625)
Then we can simplify this equation to get:
min(0.382, 0.0568125)
Then we can take out the smaller number:
0.0568125
Then, with our smaller number, we can take C and divide it by our new number:
C/0.0568125
We can then add in the value of C:
0.0394875/0.0568125
To get a final answer of:
0.6949
Then we can have our final size of:
0.3, 0 for the square frame, 0.2821, 0 for the tall frame, and 0.6949, 0 for the wide frame
That looks like this: ![]()
Thanks for reading
Thank you all so much for reading this post! I plan to have more like this post in the future, but goodbye for now!
Just so you all know, I am a mathematics-based developer working on making a few different plugins to help builders, modelers, and, as shown in this post, even UI/UX designers. So, if you are looking to find helpful posts like this in the future, tune in for more posts, have a great day, everyone!





