Ok so I want to move through my world by dragging it with the mouse, like how Flash, Photoshop, etc. does it when you hold down the spacebar.
The way I have gone about this is by adding a variable to the Scroller class called focusPoint:Point. Which I put the point that I want it to focus on. Then in updateScroll function added
This makes it set the pos as a point instead of taking it from a DisplayObject. This means I have to localize what I am setting the focusPoint as before setting it, which I believe I have.
Now it works the same way as the drag function in Photoshop and all the other adobe programs, where you hold the spacebar then click and you can drag the screen around. The only problem is once I start to drag it, the World I am dragging starts to switch between 2 different points, neither of which are correct points but seem to equal and opposite distance from the mouse. Once I let go of the mouse button the world stays on one point and everything is fine. As soon as I try dragging it again it does the same exact thing.
Is there something else updating the world that I am not seeing?
Is there so variable I don't know about?
Thank you for your help. I will post code and answer any question if any of it was unclear,
The way I have gone about this is by adding a variable to the Scroller class called focusPoint:Point. Which I put the point that I want it to focus on. Then in updateScroll function added
Code:
if (focusPoint) {
pos = focusPoint;
} else if (focus) { //..Original code from here on
pos = focusPoint;
} else if (focus) { //..Original code from here on
This makes it set the pos as a point instead of taking it from a DisplayObject. This means I have to localize what I am setting the focusPoint as before setting it, which I believe I have.
Now it works the same way as the drag function in Photoshop and all the other adobe programs, where you hold the spacebar then click and you can drag the screen around. The only problem is once I start to drag it, the World I am dragging starts to switch between 2 different points, neither of which are correct points but seem to equal and opposite distance from the mouse. Once I let go of the mouse button the world stays on one point and everything is fine. As soon as I try dragging it again it does the same exact thing.
Is there something else updating the world that I am not seeing?
Is there so variable I don't know about?
Thank you for your help. I will post code and answer any question if any of it was unclear,