Zooming on pixel art loses origin

I have 8x8 pixel sprites and am trying to zoom on them as per the pixel art manual:
msg.post("@render:", "use_fixed_projection", { zoom = 4 })

When I don’t have the above line, I see my tiny tilemap at the bottom left corner of the screen. When I use the line, the whole screen is black. Based on the examples in the pixel art manual, it looks like the line zooms into the center of the screen, but it makes much more sense for me if the origin remains at the bottom left after zooming in. How can I do this? I’ve tried using a camera component that is centered at the origin, but the same all-black screen occurs.
When using camera, I use:

msg.post('/go#camera', 'acquire_camera_focus')
msg.post(@render:, use_camera_projection)

Thanks!

1 Like

Did you also check the Orthographic Projection checkbox of the camera?

2 Likes

Hi @britzl,

Thanks for the response! Yes, orthographic projection is checked. I thought if I zoomed the camera out a lot by setting Orthographic Zoom = 0.1 I might see the tiles on screen again, but even after doing that I don’t see the tiles. I only see them when I don’t use the camera at all, it seems. I also tried dragging a huge sprite into the world. When I am using the camera, I still get an all black screen, but without the camera I do see the big sprite filling the screen.

Ah, I just figured it out… the Z-coordinate of my tilemap was 0, but the camera was set with low Z = 0.1. Ha, glad I got it figured out. Thanks again for your response!

2 Likes