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 am using Andengine and when I start the examples there are black borders on left and right of the screen. Like this:


where 1 is black and 0 is not black. On my phone (Google Nexus 4) it is always. In emulator sometimes. it is in all examples from here:

What is causing this?

share|improve this question
up vote 2 down vote accepted

Most likely this is because of the ResolutionPolicy you defined. For example if you choose the RatioResolutionPolicy AndEngine will try to keep the same width/height ratio, even if the real device resolutions vary. If you have a screen that is wider than the ratio allows, it will show the mentioned black bars.

You can find all the resolution policies in the GitHub Folder

Consider using CroppedResolutionPolicy that stretches the image beyond the borders and instead of black bars, you will get a bit of your screen cropped. The linked class will also give you two methods to find out how much was cropped.

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.