Yeah, I’m answering this question myself. Because I will inevitably forget and then search the forums again. Hi, future me!
Assume you have set your dimensions as 960x540 in game.project. You’re playing on a 1920x1080 monitor. If you place your cursor in the top right, the position of your input would be:
action.x,y → 960 x 540
action.screen_x,y → 1920 x 1080
So, to help me think about it, you might call action.xy something like “action.game_project_xy” instead, since the input is translated to fit your game project dimensions.
BONUS:
In Orthographic, “screen” co-ordinates refers to action.xy, and “window” co-ordinates refers to action.screen_xy. This is explained in the docs.
If anyone else has any other tips to add, feel free. I’m always struggling to conceptualise input on different resolutions and stretched game windows, etc, so anything will be helpful.
Man doing this kind of “help for future me” is such a good idea hahaha, its just like taking notes but they’re available for everyone else too. I’ve struggled with this same thing in the past, and I’m not entirely sure that it won’t happen again XD so thanks from future me too haha.
So much thank you!
I am here to say that this information is missing in the manual (Mouse and touch input in Defold ) and should be added, your post saved me I was searching this in the manual or the API!
There is examples using x ou screen_x sometime, but the manual doesn’t explain whats the difference!
Nice thank you very much, it is now crystal clear!
This last post should definitly be in the manual!!
Because I am kind of RTFM people so…I RTFM not … forums for documentation!
And with version 1.12 we can complete the last part with the new camera.screen_to_world() API.