This commit is contained in:
Ziver Koc 2007-04-17 15:55:22 +00:00
parent 98cd3b8287
commit 0bfc621ade
6 changed files with 32 additions and 20 deletions

View file

@ -64,6 +64,17 @@ public class SelectBox {
* @param v The value of the health bar
*/
public void setValue(int v){
value.setSize(new Vector2f((v/max)*width,height));
value.setSize(new Vector2f(((float)v/max)*width,height));//(v/max)*width
value.setLocation(new Vector2f(-width/2+(((float)v/max)*width)/2,-width/2+height/2));
if(((float)v/max) < 0.15f){
value.getTexture().setColor(new Vector4f(1.0f, 0f, 0f, 0.6f));
}
else if(((float)v/max) < 0.50f){
value.getTexture().setColor(new Vector4f(1.0f, .95f, 0, 0.6f));
}
else{
value.getTexture().setColor(new Vector4f(0.3f, 1.0f, 0.3f, 0.6f));
}
}
}