Need help with rendercam and resolutions


#1

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.


#2

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?)


#3

@ross.grams Thank you for the fast answer.

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


#4

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.


#5

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?) ).


#6

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.

#7

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?


#8

“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.