Different Resolutions for Game and Touch Controls

Hello, everyone. I was trying to make touch controls for my mobile game. I want the game to maintain its original resolution no matter how wide your mobile device is. However, the controls also go with the resolution of the game. What I want to do is keep the aspect ratio of the game (with a restricted view) while the touch controls stretch to the sides depending on the width of the mobile device screen like these ones in the pictures:

From 16/9 to 16/10 or 16/11 doesn’t change that much. You can get a result like your second screenshot, where the buttons won’t always be on the extreme edge, but are clearly out of the restricted game area.
Although, perhaps the anchor behavior could work. You should give it a good try.

Thank you for the reply. I actually tried the anchor behavior before and it would usually work if the width of the game is stretched to the edges of the screen. However, if I wanted to have the screen resolution at a 4:3 ratio, the controls would also be restricted to that ratio moving the buttons so far into the middle of the screen making them hard to reach. My only goal is to give the player a restricted view while making the touch controls easy to reach. The anchor behavior doesn’t do this for me at the moment-or I just probably do not know how to use it well. :frowning:

It is not possible to have assets outside of the render area of the game. You have to have the game resolution be in the area you want the controls to be. However, 'd use what Gruk mentions, but I’d also ensure your resolution is set to the full screen AND add some things to restrict the view.

After setting up the resolution to fit the full screen, also add large black sprites on each side (top/bottom/left/right) of the “viewable area” on the GUI layer with your controls (on a lower Z order, so they appear under the controls). This way your player has a restricted view of the playing field (it will seem like they just have a normal border like you’d expect), even though your game is actually full screen, and your controls can be outside of the viewable game area.

1 Like