From e87948a3ca483ea7f9958dd82fdfad6efd5510ba Mon Sep 17 00:00:00 2001 From: Calic Date: Sun, 24 May 2026 03:17:16 +0200 Subject: [PATCH] Wrap map draw in camera.begin/finish so world-space transforms apply Without the camera scope, maps.draw_map() rendered the map at screen coords starting at (0,0) regardless of camera.set_target, and screen_to_world's inverse produced bogus cell coords (mouse in screen-center mapped to top-left tile). Spine-prototype's render() shows the right pattern: world-space draws inside camera.begin/finish, screen-space overlays after. --- init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index e93f61f..94f30bb 100644 --- a/init.lua +++ b/init.lua @@ -595,6 +595,8 @@ function update(ctx, dt) end function render(ctx) - maps.draw_map() - ui.draw() + camera.begin() + maps.draw_map() + camera.finish() + ui.draw() -- screen-space overlays after camera ends end