@Override public void onDraw(GLState pGLState, Camera pCamera) { super.onDraw(pGLState, pCamera); mBackgroundPages.get(mCurrentIndex).onDraw(pGLState, pCamera, mOffset); mBackgroundPages .get((mCurrentIndex + 1) % mBackgroundPages.size()) .onDraw(pGLState, pCamera, mOffset - pCamera.getWidth()); }
@Override public void onUpdate(float pSecondsElapsed) { mOffset = (mOffset + 5); // % mTotalWidth; if (mOffset >= 1280) { mCurrentIndex = (mCurrentIndex + 1) % mBackgroundPages.size(); mOffset %= 1280; ; } super.onUpdate(pSecondsElapsed); }