An open API service indexing awesome lists of open source software.

https://github.com/defold/sample-screen-to-world-coordinates

This sample project shows how to convert from screen to world coordinates while using a camera component.
https://github.com/defold/sample-screen-to-world-coordinates

Last synced: 3 months ago
JSON representation

This sample project shows how to convert from screen to world coordinates while using a camera component.

Awesome Lists containing this project

README

          

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.

## Credits
Graphics by [Kenney.nl](https://kenney.nl/)