I am making a small Tilemap based game with Touch Input - by swiping i want to move the map a little, case given player walks into edges of the world
here’s what it looks like
Camera x, y, width, height all refer to the the camera viewport (the camera “window” on the game canvas). For panning and bounds you shouldn’t use those at all (nor setViewport()). Instead use camera midPoint or worldView, which describe the camera’s view in world coordinates.
the only problem remaining is that the camera is stopping to follow the player after its been moved - but that’s a different topic i guess - nevertheless are any comments on the subject heavily appreciated.
Edit: best way to avoid the problem i was running in is setting up the camera right in the first place: