[SOLVED] Trouble Attaching Bitmap Text & Planes to GuiNode

I’m trying to attach a “cast bar” Spatial to the guiNode, and I ran into trouble getting planes and text to appear on the guiNode.

I switched from a plane to instead use a box with the same material, and it suddenly appeared. I thought it was maybe a result of the plane facing the wrong way, but rotating it a few different ways still didn’t get it to appear.

Now I’m having the same issue getting bitmap text to appear once its attached to the guiNode. I’m running a test case in my main classy with the following code.

    BitmapText castText = new BitmapText(getAssetManager().loadFont("Interface/Fonts/Nyala.fnt"));
    castText.setColor(ColorRGBA.White);
    castText.setText("test");
    castText.setSize(15);

    castText.setLocalTranslation(width /2, height /2, 0);
    getGuiNode().attachChild(castText);
    castText.setLocalScale(80);

If I switch that code slightly and get rid of the BitmapText and attach a node at the same spot, then it appears on the screen as expected.

    Node castCircleNode = (Node) getAssetManager().loadModel("Interface/CastBar/castCircle.j3o");
            
    castCircleNode.setLocalTranslation(width /2, height /2, 0);
    getGuiNode().attachChild(castCircleNode);
    castCircleNode.setLocalScale(80);

Am I missing something else I need to do to get the BitmapText to show up? I searched around and couldn’t find a
solution that worked for me, although based on old posts it sounds like others have been able to get BitmapText to appear on the GuiNode.

I use Bitmapfont.createlabel personally, never had an issue.

I don’t see anything wrong with this code other than the fact that it will make text that is 1200 pixels high. That makes me think that maybe you’ve done something strange to your gui node that is the cause of this issue.

Something like flipping the scale to negative or something which would cause the back faces of every quad to be rendered (ie: not rendered).

1 Like

I was not aware that the local scale and text size can determine the exact pixel size like that simply, but I think that helped me fix the issue. I tried changing the local scale and text size to better values, and now its showing up.

Thank you both for the quick replies :slightly_smiling_face:

In the guiNode units = pixels…unless you’ve scaled the guiNode itself. (not generally a great idea)