Flip images on finger movements
I have to flip the images depends on the movement of finger.The movement of finger is either in clock wise direction or in anti clockwise direction.If the finger moves in clockwise direction I have to show the next image using shownext() of flipper otherwise I have to us开发者_开发百科e the showprevious() of flipper to show the previous one.Sorry for the bad english.Any help will be appreciated.
Each movement of the finger will give you an x- and y-coordinate. Then you have to compare these coordinates to the previous and this will tell you wether the finger is moving clockwise or counter clockwise:
x-- && y-- = counter clockwise
x-- && y++ = clockwise
x++ && y-- = clockwise
x++ && y++ = counter clockwise
The only problem is that the finger might not go in the same direction the whole time, so you might check only every 10th oder 20th coordinate pair.
精彩评论