This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

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 https://ibb.co/pzyhQRr

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.

in Engine by (12 points)

1 Answer

0 votes

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?

by (176 points)

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

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.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.