Cursor and touch action.x / action.y is not based on the current resolution

This was a strange one. Cursor/touch coordinates are based on the resolution setting in the menus, rather than the current resolution.

I expected the top right corner input position values to be the same as the current resolution, but it turned out to be 720x1280, which is the resolution defined in the project. Resizing the window didn’t change the input position either.

It caused additional issues in combination with this:

(And yes, I know how to solve it in my case, but the touch action should really be based on the current screen resolution rather than the resolution setting in the project)

There’s action.screen_x and action.screen_y that contains the values you want.

Ah, that’s pretty convenient! How come that’s not the default though? Not sure what the other value would be used for even

It’s because of resolution independence. If you, for instance, set positions of GUI nodes (or game objects) based on input position it’s easier to use x and y, otherwise you have to scale the values if the target device has a different resolution than the game.

Alright, makes sense!

Perhaps something like this would be neat:
action.gui_x
action.gui_y
action.screen_x
action.screen_y
action.world_x
action.world_y

world_x and world_y would not work, unfortunately, since you need to be aware of how the render script is set up to calculate the world space positions.