2D Toolkit Forum
2D Toolkit => Support => Topic started by: RakeshChatra on December 27, 2013, 07:25:20 am
-
Hi, i am trying to pan a world map which of size 1024*768. I want the map to move left and right depending on touch directions. I have tried panning by instantiating 2 maps on either side of the center map and making it to shift the positions. But the problem is i am making many changes on the center map and these changes should be made to other maps also at runtime which is a hectic job.. Can somebody who has already worked on this. How to achieve the panning of map using camera. thanx in advance..
-
Its better to move the camera, you'll be moving more game objects otherwise. To pan with the camera, simply apply the same inverse transform to the camera instead of the objects.
-
thank you unikron for replying.. but how make the invers e transform for the camera ?? should i use 3 camera instead of 3 maps one at the centre one at the left end and one at the right end ???
-
Yeah you can do that if you want. This is pretty much open ended really - this might be a really easy way to do it, with some masking for each camera (using viewports, etc) you should be able to get decent results.