Hey all!
Sorry if this has already been posted, but I haven’t seen anything on it. Ran into another small problem that I’ve been trying to wrap my head around the last few days.
So I followed this tutorial.
https://coronalabs.com/blog/2013/01/22/implementing-pinch-zoom-rotate/
I am working with a large “map” image that the user will be able to drag and zoom in and out of.
Once I got that implemented I needed to restrict the zoom and was able to get that.
if background.xScale \> 1.5 then background.xScale, background.yScale = 1.5, 1.5 elseif background.xScale == 1 then background.xScale, background.yScale = 1, 1 elseif background.xScale \< 0.7 then background.xScale, background.yScale = 0.7, 0.7 end
Now I’m trying to get this large “map” image not to be dragged off the screen when they reach the edge of the image. With the different scaling restriction I figured it would be a little easier, but I’m lost and can’t seem to figure it out.
Any help would be appreciated!
Thank you in advanced!