Hello,
I am currently stumped with an issue that I have searched high and low for a solution to, but with no luck.
I have a top down map in java 2d which is larger than the view port (a JPanel extending Canvas). The map is 1920x, 1152y and my JPanel viewport is 1280x, 800y.
What I want to be able to do is click on the screen and get the world map x,y coords and not the screens x,y coords.
Currently, its fine until the viewport moves beyond the 1280x800 area of the world map, so that when I click the screen, instead of it returning the world map coords, say 1900x, 900y, its just returning the current x,y position of the viewport.
I’m sure there’s a solution out there, but I’m reasonably new to games coding, so any help would be most gratefully received!
Thanks