Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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:

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

@Override
protected int getRenderSurfaceViewID() {
        return R.id.xmllayoutexample_rendersurfaceview;
}

Code fragment from the linked forum post.

share|improve this answer
add comment

Your Answer

 
discard

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