Hi everybody!
I am a bit confused that there’s no good tutorial how to add text information so it can be displayed while running the project. As far as I know text like FPS counter is a part of guiNode - a 2d “node” to display text information.
So I am asking fo a little help how to be able to put and text I wish there (like, for example, current camera coordinates).
Based on this info, I think it would be great to make a tutorial.
Thank you!
If you are using JMP, there is a snippet of code to display a hud text.
When on a java file in the top right corner window called “palette”, in the “JME Scene” section drag in the “Hud text” item to your java file
this code is written :
/** Write text on the screen (HUD) */
guiNode.detachAllChildren();
guiFont = assetManager.loadFont(“Interface/Fonts/Default.fnt”);
BitmapText helloText = new BitmapText(guiFont, false);
helloText.setSize(guiFont.getCharSet().getRenderedSize());
helloText.setText(“Hello World”);
helloText.setLocalTranslation(300, helloText.getLineHeight(), 0);
guiNode.attachChild(helloText);
You don’t have to detach all children of course, but this is a good way to display info on screen.