The projections don't change, why?

Hello, guys! My question may seem very stupid, but I really can’t understand why in the example project from defold “Pixel Line Platformer”, you need to put msg.post(“@render:”, “use_camera_projection”) and camera projections if it doesn’t affect anything?

But it does affect something? It will make the render script use both the camera view AND projection.

2 Likes

I was just curious why they should be used if they don’t have any effect, they’re just extra lines of code… But I still don’t understand why the projection types don’t work, maybe I want to keep the screen ratio and show the same content regardless of the screen? Or when using a camera you need to set it up differently… Sorry for being stupid… but as I understand it I should change the camera zoom depending on the screen size?

Please explain, kind man!

LIke Björn said, they do have effect.
What makes you believe they don’t have any effect?

1 Like

Please take a look: Pixel line platformer - Defold 1.9.7 2025-03-05 16-28-04.mp4 - Google Drive
I also have another question: why sometimes, when I change the screen size, the whole world starts shaking? By the way, it’s not only when the screen is small that it starts to shake, sometimes the same thing happens on decent-sized screens.

Ah, ok, my apologies. In level.script there’s currently:

function init(self)
	msg.post("@render:", "use_fixed_projection", { zoom = 3, near = -10, far = 10 })
	msg.post("@render:", "clear_color", { color = BACKGROUND_COLOR })
end

The “use_fixed_projection” is no longer needed since the camera nowadays takes care of setting the zoom and near and far planes. This was not the case when this sample was created. I have removed that line of code to not confuse anyone else.

1 Like

I have also removed the “use_camera_projection” in player.script since the latest camera update takes care of this automatically. Sorry for the confusion!

1 Like

Thank you so much, you helped a lot! ^'^

1 Like