Simplify a node structure for a scaled viewport

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By TomD88

Hi,
I’m creating a clone of Space Invader to experiment with Godot.

I’m trying to display a 16x16 sprite inside a window of 600x600 pixel.
I want the sprite to scale and become bigger and I’ve done this using this Scenetree Keep-Effect hosted at ImgBB — ImgBB

I’ve nested a viewport(inside a Control/ViewportContainer) in the root viewport.

The ViewportContainer has the same size of the window (600x600) with stretch “On” and the viewport has 200X200.

The Window has Mode 2D, aspect keep and size 600x600
The player node has a GDscript that clamp it’s position to the nested viewport size.

The effect is ok but probably there is a better way to do this using only a window than using my previous solution. Any suggestion?

Thank in advance.

:bust_in_silhouette: Reply From: Poobslag

Couldn’t you make the project 200x200, and set the display/window/stretch/mode configuration property to 2d? Or, does that give you a different effect than what you’re going for?

Hi,
Thank you for the response.
This is the result using your setting. I think I’m doing something wrong.

TomD88 | 2020-04-16 21:29

Is the window resizable, or did you disable that?

That’s more or less the effect I was imagining, except that the window would be resizable, start at a larger size, or possibly fullscreen.

Poobslag | 2020-04-17 19:32