Turn onOffsetsChanged engine. The xOffset variable is a floating point value from 0 to 1, where 0 is the leftmost screen and 1 is the rightmost. Use the screen width (from onSurfaceChanged) and the width of your image to determine the left coordinate x, with which you can make an image.
(screenWidth - yourImageWidth) * (1 - xOffset);
This should work both with screenWidth > yourImageWidthandscreenWidth < yourImageWidth.
source
share