What is the difference between action.xy and action.screen_xy? (SOLVED)

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.

14 Likes

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.

8 Likes