i implemented my Game UI in openGL using Orthographic projection, I have windows that varies from fullscreens to pop-ups to panels which renders on top of a 3D game.
what I did was I had a working dimension where 2D arts will be based on that, the working dimension we decided is HD 1920x1080p. Currently, if the screen size or aspect ration is diferent from our working width,
we just resize the entire screen and UI, since it is rendered in an FBO, we just resize the FBO based on the current screen size. Unfortunately some of our fullscreen UIs looked stretched.
One example is we have a screen that is full screen and has a huge circle in the middle, when run in mobile with different aspect ratio (its a mobile game engine by the way), it looks stretched.
I read somewhere that rendering the 3D game viewport should be separate from 2D to prevent this. But how to handle this situation?
Should the UI maintain its size/dimension if the screen is different? say if our working size is HD, and the screens is greater than that, then the UI will no longer be displayed as fullscreen?
Or should I render the screen background in fullscreen still but the content element should be maintained including positions of UI elements like buttons? On my example above is the huge circle in the middle of our UI in a full screen window.
Whats the best approach on this? or are there any resources to read online about this?
most of the game engine making book including game engine tutorials online are focused on the 3D stuff and does not include the UI part of it.
your help will be greatly appreciated.