Text label within 3d scene

The jme2 docs seem to have this but I can’t find anything in jme3 - is there any way I can display simple text labels next to spatials? This isn’t intended as a part of the GUI (and doesn’t need to be interacted with), I’d just like to label mesh objects.

1 Like

Ran into it by chance, works very nice!



[java]

BitmapFont labelFont = assetManager.loadFont("Interface/Fonts/Default.fnt");

BitmapText label = new BitmapText(labelFont);

label.setSize(1);

label.setText(p.partyName);

label.setLocalTranslation(p.initialCoordinatesX, z + 1, p.initialCoordinatesY);

label.rotate(-1.2f, 0, 0);

label.setQueueBucket(Bucket.Transparent);

rootNode.attachChild(label);

[/java]