Need help with rendercam and resolutions

Hello everyone.
I am trying to make a 2D mobile game, and I ran to a problem with using different resolutions and view modes. So I watched some videos, and read guides about rendercam extension but I still don’t know what modes should I use (Expand view, fixed area, fixed width, fixed height, fixed aspect ratio and etc.) I want to make my game look the same on different resolutions, but when I try to stretch the window on my PC it gets black borders. I tried to stretch tutorial games and it works perfectly, but I don’t know how to make the same on my game. Please explain me, because I am clearly missing something out :smiley:

Thanks for the help and support.

If you use “Fixed Aspect Ratio”, then you will get black borders if the aspect ratio of the window is different than the aspect ratio that you set on the camera.

If “Fixed Aspect Ratio” is turned off, then you should never get black borders (unless that’s how your game looks by itself).

In the tutorial games that you are talking about, what render script do they use? (In the game.project file, what does it say under bootstrap > Render?)

@ross.grams Thank you for the fast answer.

http://prntscr.com/mivjhd (I took Side scroller tutorial as an example)

OK. Well, that render script will stretch the contents of the original window to fit the current window, regardless of size or proportion. Rendercam actually doesn’t have that option (I never imagined that someone would ever want that). Defold Orthographic does though, and it has pretty much the same features as Rendercam does, so I suggest you use that instead.

Hmm… So what modes using rendercam should I select then? Because I don’t know what to select for it to be good for all the mobile devices and resolutions? (Without black borders, and people with bigger phones and resolutions wouldn’t have an advantage (the view would be the same, only the assets size would change?) ).

Well, something always has to change when the window/screen size changes.

  • Default - (Non-Rendercam) - If you’re stretching things, then everyone will see the same stuff, but your graphics will be distorted.
  • Fixed Aspect Ratio - Everyone will have exactly the same view, but not all of the screen will be used.
  • Expand View - Probably not very useful. Things will always be the same size in pixels, but the view area will be more or less depending on resolution. Text editors and utilities tend to work like this.
  • Fixed Width - Everyone will see the same width, but may see more or less top-and-bottom.
    • Might be good for a sidescroller where the horizontal view distance is the most crucial.
  • Fixed Height - Everyone will see the same height, but more or less side-to-side.
    • Might be good for a vertical scroller, but the game may need to adapt to different widths.
  • Fixed Area - Great for when the exact width and height don’t matter, lets everyone see the same amount of space.
2 Likes

Thank you for your comprehensive answer. So basically if I don’t want to get black borders on different resolutions - the graphics would suffer,
and if I don’t want to make my graphics to be distorded, black borders will always be on the sides?

“Suffer” is not the word I would use, haha, but . . . something, yes. It’s really more of an issue for gameplay than for graphics. I don’t know what kind of game you’re making, or have much experience with the mobile market myself, so I can’t tell you what the “right” one is. If possible, you should find apps similar to the one you are making and test them on different sized devices to see how they dealt with it.

Maybe some others here will share how they dealt with this.

Oh also, if you’re using a fixed aspect ratio, the borders don’t have to be black. You can send a message to the render script to set the clear color to whatever you want, or draw GUI nodes over the bars with whatever graphics you want.

Hi Mr. Ross,

I chosen this option, and it seems like it works as expected on my computer, but it doesn’t work on my phone:

  • On computer (resize window):

Why did the game object width is not the same at the phone width? Is it because I did something wrong?

Thanks a lot!

1 Like