LOL
This commit is contained in:
parent
347a269c4d
commit
8ff57fda63
3 changed files with 12 additions and 11 deletions
|
|
@ -11,8 +11,8 @@ public class SelectBox {
|
|||
private Node selectNode;
|
||||
private Sprite value;
|
||||
private int max;
|
||||
private float whidth;
|
||||
private static final float hight = 3;
|
||||
private float width;
|
||||
private static final float height = 3;
|
||||
|
||||
/**
|
||||
* Creates a selection box with health bar
|
||||
|
|
@ -23,7 +23,7 @@ public class SelectBox {
|
|||
*/
|
||||
public SelectBox(float x, float y, int max){
|
||||
this.max = max;
|
||||
this.whidth = x;
|
||||
this.width = x;
|
||||
selectNode = new Node("SelectionNode");
|
||||
|
||||
Texture tex = new Texture();
|
||||
|
|
@ -33,13 +33,13 @@ public class SelectBox {
|
|||
tex2.setColor(new Vector4f(0.3f, 1.0f, 0.3f, 0.6f));
|
||||
|
||||
value = new Sprite("Healthvalue",tex2);
|
||||
value.setSize(new Vector2f(x,hight));
|
||||
value.setLocation(new Vector2f(0,-x/2+hight/2));
|
||||
value.setSize(new Vector2f(x,height));
|
||||
value.setLocation(new Vector2f(0,-x/2+height/2));
|
||||
selectNode.add(value);
|
||||
|
||||
Box bar = new Box("bar",tex);
|
||||
bar.setSize(new Vector2f(x,hight));
|
||||
bar.setLocation(new Vector2f(0,-x/2+hight/2));
|
||||
bar.setSize(new Vector2f(x,height));
|
||||
bar.setLocation(new Vector2f(0,-x/2+height/2));
|
||||
selectNode.add(bar);
|
||||
|
||||
Box select = new Box("select",tex);
|
||||
|
|
@ -64,6 +64,6 @@ public class SelectBox {
|
|||
* @param v The value of the health bar
|
||||
*/
|
||||
public void setValue(int v){
|
||||
value.setSize(new Vector2f((v/max)*whidth,hight));
|
||||
value.setSize(new Vector2f((v/max)*width,height));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue