I am attempting to make the view scroll while the user has their mouse on the right or left side of the window. It is scrolling over and image and I need it to automatically stop when it reaches the edge of the image.
I have a tried few methods, but none have worked out.
[list=1]1. I have tried putting a line of black of pixels along the first and last columns. I then had the program look at the current pixels that the mouse is over and look for the black pixels, but as there has to be a margin area for the mouse to scroll with that didn't work.
2. I put another line of pixels at the edge of the scrolling margin but that didn't work out as planned either.
3. I have tried just sensing the black surrounding the image, but that isn't part of the image, so I can't sense it for a color.[/list:o]
I can think of only one more method, but I have no idea how to implement it.
-Somehow have the computer know where the view is on the image.
The only trouble I have with this is that the Offset for scrolling is 100f * the frame rate. I assume that will make the frame rate vary from computer to computer, so I can't count using that. Correct if I'm mistaken.
Don't know if this will help but:
The window is 1280x720.
The image is 3840x720 (3x the window length).