Processing for Android

offsetX

When you have several home screens, this variable tells you where you are across the horizontal direction: 0 if you swipe all the way to the left in your home screen, and 1 when you are at the right edge. This post on stackoverflow explains in more detail how the x offset works.