Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have game play scene in which user can zoom in and out. For which I used smooth camera in the following manner.

           public static final int CAMERA_WIDTH = 1024;
           public static final int CAMERA_HEIGHT = 600;
           public static final float MAXIMUM_VELOCITY_X = 400f;
           public static final float MAXIMUM_VELOCITY_Y = 400f;
           public static final float ZOOM_FACTOR_CHANGE = 1f;

            mSmoothCamera = new SmoothCamera(0, 0, Constants.CAMERA_WIDTH,
                            Constants.CAMERA_HEIGHT, Constants.MAXIMUM_VELOCITY_X,
                            Constants.MAXIMUM_VELOCITY_Y, Constants.ZOOM_FACTOR_CHANGE);
            mSmoothCamera.setBounds(0f, 0f, Constants.CAMERA_WIDTH,

But above thing create problem for me. When user perform zoom in and leave game play scene then other scene behaviour not look good. I already set zoom factor to 1 for this purpose. But now it show camera translation in other scene. Because scene switching time it so much small that player can easily saw translation of camera that I don't want to show. After camera reposition, everything works perfect but how to set camera its proper position.

For example my loading text move from bottom to top or vice versa based on camera movement.

Any more detail you want then I can able to give you.

share|improve this question

I can able to solve my problem with sudden camera jump using on update method. Following are the code snippet that I use to solve the problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.