Is there a formula to use to center a background in the camera of Andengine.
My camera is the size of the Screen on the particular device which i retrieve using this…
final Display display = getWindowManager().getDefaultDisplay();
CAMERA_WIDTH = display.getWidth();
CAMERA_HEIGHT = display.getHeight();
int x = //formula to center background in camera or screen on the X axis
int y = //formula to center background in camera or screen on the Y axis
For my SpriteBackground, how could i figure out what is the x, and y to center it in the camera?
The x and y is supplied like this..
Sprite sprite = new Sprite(x,y,TextureRegion);
This will make sprite positioned in the middle of the scene. If the camera doesn’t move around, it will be the center of the camera (hence screen) too.