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 developing game using andEngine. I need to place a progress bar in my game to denote time remaining in the game. Is there a built-in method for doing this in andEngine? My searches only turned up results for android, not for andEngine.

Can anyone give me suggestions or articles relevant to this issue?

share|improve this question

If you simply need to have a progress bar alongside your game you can use the LayoutGameActivity which was added for that purpose. LayoutGameActivity allows you to place the andEngine View into a standard Android layout which is loaded from XML, rather than using its default layout. As mentioned in the article, this is accomplished by overriding getLayoutID() and getRenderSurfaceViewID() in your game LayoutGameActivity class.

For example:

protected int getLayoutID() {
        return R.layout.xmllayoutexample;

protected int getRenderSurfaceViewID() {

Code fragment from the linked forum post.

share|improve this answer

You could also just vary the width of a simple rectangle over time, or if you want to have it nicer, stitch together a couple of sprites.

share|improve this answer

Your Answer


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