unity3d - How can I code my game to work on every resolution of Android devices? (with Unity) -
i have game made in 480x320 resolution (i have set in build settings) in unity. publish game every android device every resolution. how can it, tell unity scale game device's resolution? possible do?
thanks in advance!
the answer question largely depends on how you've implemented game. if you've created using gui textures, largely depends on how you've placed/sized objects versus screen size, makes things little tricky.
if majority of game done using objects (such planes, cubes, etc) there's 2 methods choose use.
1) first method easy implement, though doesn't good. can change camera's aspect ratio match 1 you've designed game around. in case, since you've designed game @ 4:3, you'd this:
camera.aspect = 4f/3f;
however, if someone's playing on screen meant 16:9, game end looking distorted , stretched.
2) second method isn't easy, requiring quite bit of work , calculations, give cleaner looking result you. if you're using orthographic camera, 1 important thing keep in mind regardless of screen resolution being used, orthographic camera keeps height @ set height , changes width. example, orthographic camera @ size of 10, height set 2. in mind you'd need compensate widest possible camera within each level (for example, have wide background) or dynamically change orthographic size of camera until width matches you've created.
if you've done 3d game stereoscopic camera , screen resolution shouldn't affect how looks, guess depends on game, more info required
Comments
Post a Comment