i cant change the color of my progress bar
this is my code
import com.jme3.app.Application;
import com.jme3.app.state.BaseAppState;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.simsilica.lemur.Axis;
import com.simsilica.lemur.FillMode;
import com.simsilica.lemur.*;
import com.simsilica.lemur.component.SpringGridLayout;
/**
*
* @author Pedro Quesado
*/
public class CharactersStatusState extends BaseAppState {
private Container loginPanel;
private Container xp;
private Container skill;
@Override
protected void initialize(Application app) {
loginPanel = new Container();
xp = new Container();
skill = new Container();
Container props = loginPanel.addChild(new Container(new SpringGridLayout(Axis.Y, Axis.X, FillMode.None, FillMode.Last)));
// props.setBackground(null);
props.setPreferredSize(new Vector3f(200, 70, 0));
props.addChild(new Label("HP"));
ProgressBar HP = props.addChild(new ProgressBar(), 1);
HP.setProgressValue(100); //i want this with color red
// HP.setBackground(new QuadBackgroundComponent(ColorRGBA.Red));
props.addChild(new Label("MP")); //this is gonna be blue
ProgressBar MP = props.addChild(new ProgressBar(), 1);
MP.setProgressValue(100);
// MP.setBackground(new QuadBackgroundComponent(ColorRGBA.Blue));
props.addChild(new Label("DR"));
ProgressBar DR = props.addChild(new ProgressBar(), 1);
DR.setProgressValue(20);
// DR.setBackground(new QuadBackgroundComponent(ColorRGBA.Gray));
Container pgrosse = xp.addChild(new Container(new SpringGridLayout(Axis.Y, Axis.X, FillMode.None, FillMode.Last)));
pgrosse.setPreferredSize(new Vector3f(1000, 20, 0));
pgrosse.addChild(new Label("XP")); //this yellow
ProgressBar XP = pgrosse.addChild(new ProgressBar(), 1);
XP.setProgressValue(10);
XP.setPreferredSize(new Vector3f(1000, 20, 0));
// XP.setBackground(new QuadBackgroundComponent(ColorRGBA.Brown));
Container skillmenu = skill.addChild(new Container());
skillmenu.setPreferredSize(new Vector3f(500, 50, 0));
Container q = skillmenu.addChild(new Container(new SpringGridLayout(Axis.X, Axis.Y)));
q.addChild(new Container());
q.addChild(new Container());
q.addChild(new Container());
q.addChild(new Container());
q.addChild(new Container());
q.addChild(new Container());
q.addChild(new Container());
q.addChild(new Container());
q.addChild(new Container());
q.addChild(new Container());
q.addChild(new Container());
q.addChild(new Container());
q.setPreferredSize(new Vector3f(50, 20, 0));
float scale = 1.5f * getState(MainMenuState.class).getStandardScale();
// loginPanel.setLocalScale(scale);
loginPanel.setBackground(null);
Vector3f prefs = loginPanel.getPreferredSize().clone();
prefs.x = Math.max(20, prefs.x);
loginPanel.setPreferredSize(prefs.clone());
// Now account for scaling
prefs.multLocal(scale);
int width = app.getCamera().getWidth();
int height = app.getCamera().getHeight();
loginPanel.setLocalTranslation(width * 0.10f - prefs.x * 0.10f, height * 0.10f - prefs.y * 0.0f, 10);
xp.setLocalTranslation(width * 0.10f - prefs.x * 0.10f, height * 0.03f - prefs.y * 0.0f, 10);
skill.setLocalTranslation(width * 0.23f - prefs.x * 0.0f, height * 0.080f - prefs.y * 0.0f, 10);
// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
protected void cleanup(Application app) {
// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
protected void onEnable() {
Node root = ((Main) getApplication()).getGuiNode();
root.attachChild(loginPanel);
root.attachChild(xp);
root.attachChild(skill);
/// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
protected void onDisable() {
loginPanel.removeFromParent();
xp.removeFromParent();
skill.removeFromParent();// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}