基本上,我正在尝试绘制一个空的健康条形图像,然后在其上方绘制实际的健康条形图像,以便在需要更新时只需缩短实际的健康条。这是我目前的代码:
TextureAtlas HUDatlas = new TextureAtlas(Gdx.files.internal("data/ui/HUDPack/textures.pack"));
emptyPlayerHealthBar = new Image(HUDatlas.findRegion("empty-health-bar"));
playerHealthBar = new Image(HUDatlas.findRegion("health-bar"));
//Creating the table
table = new Table(skin);
table.debug();
table.setBounds(0, 0, Gdx.graphics.getWidth(), 50);
table.left();
table.top();
table.add(playerHealthBar);
table.add(emptyPlayerHealthBar);
stage.addActor(table);
但是这会将它们并排绘制。我该如何绘制它,使图像重叠(空的生命条在底部,生命条在顶部)?