boruok
1
Does anyone have code snippet to calculate screen_to_world and versa IF your window size is different that display size?
I’m using following to calculate correct world position:
camera.screen_xy_to_world(action.x * 2, action.y * 2)
In portrait mode 180x320 scaled to 360x640 it works, but snippet doesn’t work if you maximize window size or rotate it.
AGulev
2
it should be action.screen_x and action.screen_y not action.x and action.y
AGulev
3
1 Like
boruok
4
thanks! this definitely need to be documented somewhere.
1 Like
britzl
5
Are you referring to action.x vs action.screen_x? The API reference example uses screen_x:
I’ve also updated the Screen to World example just now: Screen to World (it should be available in a couple of minutes)
4 Likes