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 want to add Progress bar with my game to display life of player but when i move down through DigitalOnScreen Control the black bar that i want to display is not displayed there. I want to display that bar when i move in any direction it should be constantly displayed Here progress bar as a image is displayed Here Progress bar is not displayed

share|improve this question
Usually, GUI items don't have a position in the world, rather just one in the camera space. a little more information about your actual code would be helpful. – Vengarioth Apr 3 '13 at 5:28
up vote 1 down vote accepted

You can use HUD.when move your camera, hud is not move that stable.

HUD hud = new HUD();


public class GameTest extends BaseGameActivity {
private Camera camera;
private Scene scene;
private HUD hud;

public Engine onLoadEngine() {
    camera = new Camera(0, 0, Helper.CAMERA_WIDTH, Helper.CAMERA_HEIGHT);
    EngineOptions engineOptions = new EngineOptions(true,
            ScreenOrientation.PORTRAIT, new RatioResolutionPolicy(
                    Helper.CAMERA_WIDTH, Helper.CAMERA_HEIGHT), camera);
    return new Engine(engineOptions);

public void onLoadResources() {

public Scene onLoadScene() {
    scene = new Scene();
    hud = new HUD();

    Sprite blackBar = new Sprite(posX, posY, yourRegion);

    return scene;

public void onLoadComplete() {


share|improve this answer
Thanks for your answer But i am using Scene so i don't know how to use HUD with Scene. – Maan Apr 3 '13 at 6:13
Thanks a lot. It's Working. – Maan Apr 3 '13 at 6:22
@Maan hud is one of Entity like scene. You can attach or detach entity in hud. also i update my code it helpful you. – Divyang Metalia Apr 3 '13 at 6:24

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.