Added a hud for the money
This commit is contained in:
parent
287e6b3e50
commit
d1a2aa8b4e
13 changed files with 34 additions and 12 deletions
|
|
@ -9,12 +9,10 @@ import ei.engine.scene.Sprite;
|
|||
import ei.engine.texture.Texture;
|
||||
|
||||
public class SelectBox {
|
||||
private static final float height = 3;
|
||||
private Node selectNode;
|
||||
private Node mouseOverNode;
|
||||
private ProgressBar bar;
|
||||
private int max;
|
||||
private float width;
|
||||
private static final float height = 3;
|
||||
|
||||
/**
|
||||
* Creates a selection box with health bar
|
||||
|
|
@ -24,15 +22,13 @@ public class SelectBox {
|
|||
* @param max The max health of the object
|
||||
*/
|
||||
public SelectBox(float x, float y, int max){
|
||||
this.max = max;
|
||||
this.width = x;
|
||||
selectNode = new Node("SelectionNode");
|
||||
mouseOverNode = new Node("MouseOverNode");
|
||||
|
||||
Texture tex = new Texture();
|
||||
tex.setColor(new Vector4f(0.5f, 1.0f, 0.5f,1));
|
||||
|
||||
bar = new ProgressBar("Health",width,height,max);
|
||||
bar = new ProgressBar("Health",x,height,max);
|
||||
bar.getNode().setLocation(new Vector2f(0,-x/2+height/2));
|
||||
selectNode.add(bar.getNode());
|
||||
mouseOverNode.add(bar.getNode());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue