public Node HitPointUI(){
ProgressBar bossHealth = new ProgressBar(new DefaultRangedValueModel(0, 100, 100));
// bossHealth.setMessage("HP");
bossHealth.getValueIndicator().setBackground(new QuadBackgroundComponent(ColorRGBA.Red));
bossHealth.setPreferredSize(new Vector3f(10f, 2.5f, 0f));
bossHealth.setLocalTranslation(0f, 5f, 0f);//还没找到让血条显示在正中间的方法
bossHealth.addControl(new BillboardControl());
bossHealth.setProgressPercent(0.5f);
bossHealth.setShadowMode(ShadowMode.Off);
return bossHealth;
}
I want to use lemurs to show the health value of each unit
I wonder if my incorrect use of the lemur is causing the bottom framerate
Here’s what it looks like with no health values displayed, looks like everything is fine with 100 units in the screen
When I add on the lemur UI there is a problem, I don’t know what is causing the low fps, but I tried some measures but nothing works
mouseState=simpleApp.getStateManager().getState(MouseAppState.class);
if(mouseState!=null){
mouseState.setIncludeDefaultCollisionRoots(false);
mouseState.addCollisionRoot(simpleApp.getGuiViewPort());
}
If you have any suggestions or ideas please message me I may not be able to get back to you right away but I will give it a try!