Screen Scaling With Preserved Aspect Ratio

Ok, so when exporting game from armory to android I noticed that the aspect ratio was not the same and the scene was showing elements of the background that should have been covered by the position of the camera.

Is the a way to keep the same aspect ratio when exporting to a device…?
A way to fit elements to screen because I saw a logic node that gets screen size but not sure what it is for or how to use!

If by aspect ratio you mean the screen orientation, then there is a file generated that you can edit inside android studio, but i don’t remember its name correctly. Probably there is an option in Armory that also changes this in the generated files, but i never used, so i can’t tell what is the exaclty thing now.

I don’t know if the “screen size” node is useful for what you want, it just allows to get the total resolution of the screen. For the “partial” resolution you should use the “Get Window Resolution” node, so it will return the current resolution of the screen and not only the maximum resolution. In Android i don’t know what would be the “screen size” because it have two orientations, so use the other node i mentioned instead, just to make sure.

2 Likes

Thanks for answering about that screen size node, i assumed it was for something like that but wasn’t sure.

As for my other questions, i wasn’t talking about the screen orientation but the different screen sizes I put my game on… On the PC my game is fine and all lucks good but when I compile it for Android and try it on my android device… The camera zooms out to far and it reveals the blank background.
This is probably due to my phone’s different screen aspect ratio and in Unity the is an option to get your game to scale to fit the device… Although I don’t know if armory has that.

I don’t know exactly what is going on with your screen, which is its aspect ratio? I guess the most phones uses 16:9 / 9:16 aspect ratio. I guess in this cases must exists a node to set the screen resolution, but is better to open an issue at Github with detailed information like prints, etc. or just send the prints here

1 Like

okay, will open an issue