This sample project shows how to convert from screen to world coordinates while using a camera component. The conversion is made in the screen_to_world(camera, x, y, z)
function in camera.lua
.
The project also shows how the screen_to_world()
function can be used to anchor game objects to the corners of the screen regardless of screen resolution and aspect ratio.
Graphics by Kenney.nl