new to jme…apologies if stupid question, help appreciated
we're making a first person shooter game btw
when we attach the CamerNode object (needed to attach weapons etc) to be used to update the camera, the input is causing problems
the line we were using when just using a Camera object was:
input = new FirstPersonHandler(cam, 20f, 0.75f);
which allowed to set the mouse and keyboard speed indivisually, but when the camNode is attached, the keyspeed is the same but the mouse isnt responding
using this line:
input = new NodeHandler(camNode, "LWJGL");
sets the mouse and keyboard to be the same speed, which seems to mean really slow keyboard and regular mouse speed, or normal keyspeed and ridiculous mouse speed
anyone any ideas??
also, when trying to display text, for example:
private void paintCrossHair(){
// Make a crosshair for the centre of display
Text cross = new Text("Crosshairs", "+");
cross.setTextColor(ColorRGBA.darkGray);
cross.setLocalTranslation(new Vector3f(display.getWidth() / 2f - 8f,
display.getHeight() / 2f - 8f, 0));
fpsNode.attachChild(cross);
}
it displays as a relatively large box instead, this is the same for when we're trying to display health etc.
jme is fun to work with
ok, got the mouse speed working, didnt see the NodeHandler constructor where you can set the speeds individually
any text on display is showing as a solid box tho, anyone have any help with this??
does anyone know the new way to do this piece of code:
keyboard = KeyBindingManager.getKeyBindingManager();
keyboard.set("fire", KeyInput.KEY_F);
input.setKeyBindingManager(keyboard)
with the last line, InputHandler class doesnt have this method (setKeyBindingManager) anymore, its not in the docs on what the new way of doing it is, anyone can help???
in the tutorials and some other places this is the code used but it doesnt seem to work anymore
can't help with the KeyBindingManager, but make sure you set your transparent HUD elements to QUEUE_TRANSPARENT and don't forget to also set an aplha state for those spatials. i also don't reccomend using Text for the corsshair. better use a quad and apply a texture.
the wiki also contains some tutorials about how to make a HUD.
thanks got them working now