I'm making a game that runs on Android and IOS. For handling resolutions, I've made all my GUI to calculate its size based on the Screen size. For example; instead of setting a button's size to "width = 200f and height = 100f", I used "width = Screen.width * 0.2f and height = Screen.height * 0.1f". And in the buttons I display Image rather than Text.
Now, when running on Android, everything is fine, I tested the game in the editor (sets the platform to Android) and on multiple Android phones and the images looks fine. However when I run the game on IOS (editor and iPad) the images in the buttons become distorted as in they got that squished.
Here are 2 images that shows the difference:
On IOS:
![alt text][1]
On Android:
![alt text][2]
I think this might be due to how the image is being scaled. As in the bigger the difference between the original size and the scaled size, the more distorted the image will be. I've tried reducing the image's size to test this idea, and it does seems to have effects. However, if this is the case, then how come I do not have any problem when running on Android? Does IOS required some additional stuff for the images? Or is this a whole different problem?
[1]: /storage/temp/33193-ios.png
[2]: /storage/temp/33194-android.png
↧