User interface¶
guiNode holds screen-space spatials. Coordinates are in the GUI view, with the origin at the bottom left. For simple text, load a bitmap font and attach a BitmapText:
BitmapFont font = assetManager.loadFont("Interface/Fonts/Default.fnt");
BitmapText label = new BitmapText(font);
label.setText("Hello, jMonkeyEngine!");
label.setLocalTranslation(20, cam.getHeight() - 20, 0);
guiNode.attachChild(label);
For more complex interfaces, we recommend Lemur, a community UI module for layouts, widgets and interaction. You can also explore other community modules in the Library. Follow the selected module’s integration guide. Design for resizing, high-DPI displays, touch targets and controller input. Test on the target device, because physical pixels and logical coordinates may differ.