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

#1

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.

Thanks

0 Likes

#2

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

image

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

#3

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.

0 Likes

#4

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

#5

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

#6

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