You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/manuals/camera.md
+26-19Lines changed: 26 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,26 +225,33 @@ An alternative way is to update the position of the game object the camera compo
225
225
When the camera has panned, zoomed or changed it's projection from the default orthographic Stretch projection the mouse coordinates provided in the `on_input()` lifecycle function will no longer match to the world coordinates of your game objects. You need to manually account for the change in view or projection. The code to convert from mouse/screen coordinates to world coordinates looks like this:
226
226
227
227
```Lua
228
-
--- Convert from screen to world coordinates
229
-
-- @param sx Screen x
230
-
-- @param sy Screen y
231
-
-- @param sz Screen z
232
-
-- @param window_width Width of the window (use render.get_width() or window.get_size().x)
233
-
-- @param window_height Height of the window (use render.get_height() or window.get_size().y)
0 commit comments