resize the screen depending on the aspect ration

hey, i’m working on a small mobile game and i’d like to have a script that automatically resizes my screen on the aspect ratio in order to have similar looks on different mobile phone versions.

for example the x size should be fixed at 320…
what the script should do is:

  1. get the Y size
  2. get the X size
  3. divide the Y by X
  4. multiply the result by 320.

usually i’m working with playmaker, my coding skills are limited… but in couldn’t get it to work on iphone, at least the part of getting the screen size.

The Screen class will have all the information you need and will be how you set the resolution.

1 Like

but screen.width and screen.height ist getting the size of the window depending on the resolution set in the game and not of the device, am i right? how do i actually get the width and height of the device?