Hello im new to Lemur. My goal is to establish a bar in an application i am currently working on.
It is an open source driving simulator. My bar should be moving depending on the current Speed of my car.
Therefore I took the ProgressBar from Lemur.
Here is the following part of my code in my mehtod:
public class PanelCenter{
private static SimulationBasics sim;
private static RangedValueModel testModel;
private static Styles testStyle;
private static String testStyleString;
private static float carSpeedB1;
}
public static void init(Simulator simulator){
sim = simulator;
.
.
.
GuiGlobals.initialize(sim);
GuiGlobals.getInstance().getStyles().setDefaultStyle(testStyleString);
double b1Value;
double percentage = 0;
b1Value = carSpeedB1;
ProgressBar b1 = new ProgressBar();
b1.setModel(TestModel);
b1.setMessage("TestMessage");
b1.setName("b1");
b1.setPreferredSize(new Vector3f(200, 200, 0));
b1.setProgressValue(b1Value);
b1.setProgressPercent(percentage);
guiNode.attachChild(b1);
b1.setLocalTranslation(150, 150, 0);
}
public static void getTestModel(Car car){
carSpeedB1 = car.getCurrentSpeedKmh();
double currentTestValue = carSpeedB1;
testModel.setValue(currentTestValue);
testModel.setPercent(currentTestValue);
double minTestValue = 0.0;
double maxTestValue = 200.0;
testModel.setMaximum(maxTestValue);
testModel.setMinimum(minTestValue);
//Style
testStyle.setDefaultStyle(testStyleString);
}
}
All i get tho is something like a box there my message “TestMessage” is shown. There is no reaction from the bar when i change the cars speed.
I know that i surely miss on crucial stuff in my code. Thats why i am asking you guys for your help.