I currently have this code:
var hammertime = new Hammer(canvasContainer);
var x0, y0;
hammertime.on('panstart', function(ev){
x0=stage.position.x;
y0=stage.position.y;
});
hammertime.on('pan', function(ev){
stage.position.x = x0 + ev.deltaX;
stage.position.y = y0+ ev.deltaY;
renderer.render(stage);
});
This pans great, but with the current code I can keep panning until the image is off the screen. How do I limit it so the image only goes e.g. half way off the screen before you can't pan in that direction any more? Is there a preset option in Hammer.js for that?