#Multiple viewport scaling issues

21 messages · Page 1 of 1 (latest)

desert falcon
#

I have tileset with 8*8 tiles. I want my in-game view (not menus). I want the game to render at 380*180 (16:9) and upscale to match viewport size (which will likely be higher than 320*180). But I don't want menus to have this resolution. Given this resolution, it should be possible to see 40*22.5 tiles on screen. My problems are

  • How do I make render resolution different for HUDs and Game?
  • How do I have to adjust camera to render that way so 40*22.5 tiles fit a screen?

And also, if my viewport size is the same as the game size (320*180). How can I make the viewport biggen on start to debugg better? I don't want full screen because I use always on top with a size of around 928*512 to have a game view big enough to view but not big enough to cover all the editor

Edited: I tried using 2 viewports, the root one (that it's by default there, I didn't add anything) and a subviewport container with a subviewport node inside the HUD). I did this trying to get the demo project for viewport to work but it doesn't :(

I just want to render my game at a low resolution and the HUD at native

agile sequoia
desert falcon
sweet karma
desert falcon
sweet karma
#

If you want fullscreen, check fullscreen

desert falcon
desert falcon
# sweet karma If you want fullscreen, check fullscreen

I want to render the game at one resolution scaling it to viewport size and on the other hand I want the hud to render at native resolution. I have to use viewports as rsubtil suggested, I just need to figure out how to make them work. Your solution would work if I wanted also the HUD to have that resolution but sadly it's not the case 😔

sweet karma
#

Do you mean you want you HUD to be a different size of the viewport?

desert falcon
sweet karma
#

Hmmm, there's an aspect ratio control node, that might be useful to keep the HUD the same size all the time while scaling the game view differently.

#

Are you using canvas layer for your HUD?

desert falcon
desert falcon
#

Multiple viewport scaling issues

#

Alright it seems I can configure the viewport nodes and it works, but I can change the size at runtime, hmmm

agile sequoia
#

I'll send an example, just a second

#
  • Set the SubViewport Size 2D Override to your desired resolution, and enable Size 2D Override Stretch
#
  • And in your SubViewportContainer, enable Stretch
#

If you also want it to preserve the aspect ratio, check what raistlintheweezymage said and place the SubViewportContainer in an AspectRatioContainer, and specify your desired aspect ratio