# Libgdx How to overlay two images on Table

I'm trying to set the player image inside the circle of the bars. I've tried to use stack, to position it topLeft but it does not work.

    Stack stack = new Stack();

healthbar = new Image(new Texture(Gdx.files.internal("data/ui/healthbar.png")));
playerLook = new Image(player.getFrame());

Table table = new Table();
table.top();
table.setFillParent(true);



First of all, we remove these two lines, because we don't want to add them separately:

table.add(healthbar).expandX().pad(10).left();


Then we change this:

stack.add(table);


to this:

table.add(stack);


Because we don't wish to add the table to the stack, we wish to add the stack to the table, and then we add the table to the stage. The result is this:

Stack stack = new Stack();

healthbar = new Image(new Texture(Gdx.files.internal("data/ui/healthbar.png")));
playerLook = new Image(player.getFrame());

• That's because it's trying to occupy the same amount of space as the other image. To solve this you can either make the images the same size, or split your health bar image into two parts - one for the circle and one for the bars - and then make a Stack with your player image and the circle. Last alternative, which I recommend, is to not use a Table for this, since table is inherently not made for stacking Actors. Instead use your own GUI class and render it on top of everything else. – Charanor Jul 9 '16 at 21:02