BillBoard Text Background color changes

Hi all 8) . I came across another problem. Not sure where to post the problem so I posted it here. I made a BillBoard Text that keeps hovering on a model, it only shows the text without any background color. It worked perfectly but when I removed the Display Stat View(setDisplayStatView(false)) the BillBoard Text started to have a black background, not sure why.

Here is my code of the BillBoard Text:

[java]
package Others;

import com.jme3.asset.AssetManager;
import com.jme3.font.BitmapFont;
import com.jme3.font.BitmapText;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial.CullHint;
import com.jme3.scene.control.BillboardControl;

/**
*

  • @author Kamran
    */
    public class StatPopUp {
    AssetManager assetManager;
    BitmapFont font;
    BitmapText textHP, textE;

    public Node textNode;

    public StatPopUp(AssetManager assetManager){
    this.assetManager = assetManager;
    textNode = new Node(“Text Node”);

     init();
    

    }

    public void init(){
    font = assetManager.loadFont(“Interface/Fonts/ComicSansMS.fnt”);
    textHP = new BitmapText(font, false);
    textHP.setText(“Health”);
    textHP.setColor(ColorRGBA.Red);
    textHP.setSize(0.6f);

     textE = new BitmapText(font, false);
     textE.setText("Energy");
     textE.setColor(new ColorRGBA(0.4f, 1.0f, 1.0f, 0.5f));
     textE.setSize(0.7f);
    

// textHP.rotate(0, 0, 1.57f);
// textHP.addControl(new BillboardControl());
textNode.attachChild(textHP);
textNode.attachChild(textE);
textNode.addControl(new BillboardControl());
textHP.setLocalTranslation(-1, 3, 0);
textE.setLocalTranslation(-1, 3.7f, 0);
}

public void setupTextAxisY(float y){
    textHP.setLocalTranslation(-1, y, 0);
    textE.setLocalTranslation(-1, y + 0.7f, 0);
}

public void setVisible(){
    textNode.setCullHint(CullHint.Inherit);
}

public void setInvisible(){
    textNode.setCullHint(CullHint.Always);
}

public void update(Vector3f position, int hp, int energy){
    if(hp <= 0){
        setInvisible();
    }
    textHP.setText(""+hp);
    textE.setText(""+energy);
    textNode.setLocalTranslation(position);
}

}
[/java]

I am also giving images to show what I mean.

  1. With FPS and Stat View Display

[java]
@Override
public void simpleInitApp() {
// setDisplayFps(false);
// setDisplayStatView(false);
setupHeadLessClasses();
setupCamAndLight();
loadGUI();
}
[/java]

  1. Without FPS and Stat View Display

[java]
@Override
public void simpleInitApp() {
setDisplayFps(false);
setDisplayStatView(false);
setupHeadLessClasses();
setupCamAndLight();
loadGUI();
}
[/java]

The problem only arises when I remove the Display Stat.

Thank you.
K Out!

The display stats thing is probably just coincidence.

Try putting your bitmap text in the transparent bucket.

@pspeed : Thanks that worked! :slight_smile: . Just added these two lines

[java]
textHP.setQueueBucket(RenderQueue.Bucket.Transparent);
textE.setQueueBucket(RenderQueue.Bucket.Transparent);
[/java]

Sorry for the late reply just woke up and tried it =D
Thanks again!

K Out!