Phoenix already touched on the camera question so I’ll cover the GUI question.
Look here for information on creating a GUI in your jME game. The short answer is that there’s two different systems that people mainly use, FengGUI and GBUI. You’ll find fans and haters for both
Okay, i saw a full tutorial o GBUI but could not understand nothing to start making my own interface. I just want to create a window, a text field and a button. nothing more than that - can someone giveme a code as example?
Another question: I saw the code of TestCameraNode.java and i have make one code for me:
private CameraNode camNode;
camNode = new CameraNode("Camera Node", display.getRenderer().getCamera());
input = new NodeHandler(camNode, 15f, 1);
Vector3f max = new Vector3f(5,5,5);
Vector3f min = new Vector3f(-5,-5,-5);
Notice though that in this test I'm using SimpleGame and if you're using multithreading you should make sure that windows get added in the OpenGL thread.
//Initiate BuiSystem
BuiSystem.init(new PolledRootNode(Timer.getTimer(), new InputHandler()), "/rsrc/style2.bss");
//Attach the rootNode to our rootNode
rootNode.attachChild(BuiSystem.getRootNode());
//Create a static window
BWindow window = new BWindow("Window", BuiSystem.getStyle(), GroupLayout.makeVert(Justification.CENTER));
//Set the size of this window
window.setSize(300, 200);
//Add a colour background to the window
window.setBackground(BWindow.DEFAULT, new TintedBackground(ColorRGBA.randomColor()));
//Create an empty text field (final in this test so it's available in the ActionListener below)
final BTextField tf = new BTextField();
//Set the preferred size of this text field
tf.setPreferredSize(100, 30);
//Create a label (final in this test so it's available in the ActionListener below)
final BLabel label = new BLabel("You wrote:");
//Create a button with an action listener
BButton button = new BButton("Button", new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
label.setText("You wrote: "+tf.getText());
}
}, "click");
button.setPreferredSize(70,40);
//Add text field, button and label to window
window.add(tf);
window.add(button);
window.add(label);
//Center window
window.center();
//Add window to BuiSystem
BuiSystem.addWindow(window);