[Solved] Window reveal more/less of screen on resize


The title probably isn’t very clear, but this is my issue: I’m creating a 2D platformer-like game. I want it to be so that when I expand the window more of the scene is revealed. I’ve looked at various perspectives, but they all seem to have a set viewport size and scale it to fill the window. I’m currently using a camera node, if that makes any difference.

Any help would be welcome; I’m familiar with lua and to some degree defold, but I’ve never gotten into render scripts much.




If you’re using the default.render maybe you just need to use the fixed projection, not sure if that’s what you want.


msg.post("@render:", "use_fixed_projection")


Thanks, but I already tried that. Fixed projection just scales the content when the window is resized. I don’t want any scaling; I just want more or less content available depending on screen size.



Hmm, are you sure you’re not sending any other messages to the render script later? For me, “use_fixed_projection” works the way you want–bigger window: more content, smaller window: less content.

1 Like


As others have already pointed out the fixed projection is what you want. Do you have any errors in the console? Is the script sending the message in use? Are you using the default render script? Share your project please.

1 Like


Ah, I looked into it, and it was a typo; I had “use_fixeds_projection” not “use_fixed_projection.”

Thanks for the help!

1 Like