Defos: Window size / resolution

Hi, everyone!

As I mentioned before post, I am new to Defold, also to programming, and I choose Defold to be the game engine I will develop my very first game and learn programming concetps, I am also learning pixel art.

Here is a picture of what I’ve do so far!

For testing porpose, I double the window size, and here what’s happend!

So far, I did script, added to the GO, and added some code following the tutorial (https://www.youtube.com/watch?v=R4oEB6e8G0A).

But the question is: how to change window size? I am using 384 x 216 under display project’s settings, I wish I could double its size. From my research, I understood that it’s only possible via Defos, and here’s the difficult: I manage to add the Defos to my project, and did it, however, I have no ideia where and how to add the code to change it. I wish I could have some help doing this.

It’s easy. Once you added the extension, you can set the window size by putting this code inside function init of the startup script

defos.set_view_size(x, y, w, h)

For more info you could view the readme at

Thank you so much, @Chung_Xa , It worked!

Actually I grabbed a wrong one, this should have been defos.set_window_size() but I’m glad that it also works for you

1 Like