Good evening everyone,
I have a simple yet mind boggling problem on my hands,
simply put I have a large MC (with its registration point in the center, i need it there), and it sits in a smaller stage (think of it like as if you were panning a map thru a viewer, like google maps) but i need a set of boundaries to prevent it from going haywire. Now i have tried a couple of methods ie
if ((boxer.x-boxer.width/2)<0) {
boxer.x=mouseX-offX;
}
if ((boxer.y-boxer.height/2)<0) {
boxer.y=mouseY-offY;
}
The above just manages to stop it but once it reaches that point the drag stops totally.
They are included in the file i have attached.
I would really appreciate it if someone could guide me on this.
Thanks so much in advance