Can't follow manual for adapting resolution

Sorry for bothering, but I don’t get along with the manual.
I don’t see where it mentions I should put:
msg.post("@render:", “use_fixed_projection”, { zoom = 4 })
I made new go and tried to put the message in init and in the update, both cases I got a black screen instead.

I can’t find where is THIS.

For now, I want simply to scale my pixel arty game.

It should be enough to send that message once. What if you set zoom to 1?

I don’t get it what was wrong. Does making a new project from an empty template means something, that’s what I did previously? Now it worked, but I was using your public example camera project and deleted everything + reverted to default project settings (except nearest neighbor scaling). I’m at work now and for a quick test, I couldn’t create a new project because of the firewall, so had to use something existing.
Which brings another thing - why Defold can’t create a new empty project offline?

My camera example is likely using a custom render script. The manual assumes the default render script.

Yeah and I deleted everything that wasn’t builtin (leaving only input folder) and reset project settings to default where it wasn’t (except nearest neighbor settings + new main.collection).
Less then an hour I’ll be home to do another test with an empty new project and desktop new project.

Seriously, I don’t get it! I just did both Desktop and empty new projects and both worked.
While THIS PROJECT is pretty much the same (just tiles and animated player object) and with render message it gives black screen.

Increase the window size - 1280x720 and replace the render setup with this

function init(self)
	msg.post("@render:", hash("use_camera_projection"))
	msg.post("@render:", hash("set_view_projection"), {id = hash('/render'), view = vmath.matrix4(), projection = vmath.matrix4_orthographic(0, 320, 0, 180, -1, 1) })
end

You were getting the black screen simply because Defold zoomed in to the area without objects, outside of your level area.

3 Likes

Was the camera or game world not positioned correctly?

Yeah it seems to be empty space.
There was nothing mentioned about camera in manual - https://www.defold.com/manuals/adapting-graphics-to-screen-size/
Later I really want to put camera in.
That’s why I prefer video format because every step is shown.
Thanks, @sergey.lerg! Now view is spot on. Now I need to learn about that setting and how to manipulate camera.

1 Like