문제

I try to use setRotation() on my GLSurfaceView, but the view seems not rotate around the pivot which is the center of the screen. the code like below:

class MyGLSurfaceView extends GLSurfaceView {
    private float mCurRotation = 0.0f;

    @Override
    public boolean onTouchEvent(MotionEvent e) {
        mCurRotation = mCurRotation + 10;
        setRotation(mCurRotation);
    }
}

Is there any body know the reason and teach me how to rotate my GLSurfaceView?

도움이 되었습니까?

해결책

Contrary to your expectation, methods of View doesn't work well.

GLSurfaceView punches a hole to display underneath surface. Actually it has only transparent pixels.

If you want to rotate your image, you have to use OpenGL operations.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top