Skip to content
Snippets Groups Projects
Commit 4cb5b404 authored by Magnus Segtnan Skjølberg's avatar Magnus Segtnan Skjølberg
Browse files

(#18): correct healthbar pos, rotation and value

parent feec88f8
No related branches found
No related tags found
3 merge requests!51Resolve "Adjust cannon angle from touch input",!35Draft: Resolve "Adjust cannon angle from touch input",!32Combine hud with gameplay
......@@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Button;
import com.badlogic.gdx.scenes.scene2d.ui.Container;
import com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar;
......@@ -51,12 +52,17 @@ public class GameHud {
skin = new FreeTypeSkin(Gdx.files.internal("gameplay-skin.json"));
healthProgressBarPlayer = new ProgressBar(0, 100, 1, false, skin);
healthProgressBarPlayer.setValue(40);
healthProgressBarPlayer.setValue(100);
healthProgressBarOpponent = new ProgressBar(0, 100, 1, false, skin);
healthProgressBarOpponent.setValue(40);
healthProgressBarOpponent.setValue(100);
Container HpOpponentWrapper = new Container(healthProgressBarOpponent);
HpOpponentWrapper.setTransform(true);
HpOpponentWrapper.setOrigin(HpOpponentWrapper.getPrefWidth() / 2, HpOpponentWrapper.getPrefHeight() / 2);
HpOpponentWrapper.setRotation(180);
table.add(healthProgressBarPlayer).expand().top().left().padTop(10).padLeft(10);
table.add(healthProgressBarOpponent).expand().top().right().padTop(10).padRight(10);
table.add(HpOpponentWrapper).colspan(2).top().right().padTop(10).padRight(10);
table.row();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment