Hi.
I'm new to jME and I've made the Flag Rush Tutorial more or less.
Now, I've got the problem that I don't manage to include a mouse in my app…
I can see something that looks like a cursor, but I can't move it…
I use this code which I found somewhere in the wiki:
// Create a new mouse. Restrict its movements to the display screen.
am = new AbsoluteMouse("The Mouse", display.getWidth(), display
.getHeight());
// Get a picture for my mouse.
TextureState ts = display.getRenderer().createTextureState();
URL cursorLoc = HelloMousePick.class.getClassLoader().getResource(
"test2/cursor1.png" );
Texture t = TextureManager.loadTexture(cursorLoc, Texture.MM_LINEAR,
Texture.FM_LINEAR);
ts.setTexture(t);
am.setRenderState(ts);
// Make the mouse's background blend with what's already there
AlphaState as = display.getRenderer().createAlphaState();
as.setBlendEnabled(true);
as.setSrcFunction(AlphaState.SB_SRC_ALPHA);
as.setDstFunction(AlphaState.DB_ONE_MINUS_SRC_ALPHA);
as.setTestEnabled(true);
as.setTestFunction(AlphaState.TF_GREATER);
am.setRenderState(as);
// Get the mouse input device and assign it to the AbsoluteMouse
// Move the mouse to the middle of the screen to start with
am.setLocalTranslation(new Vector3f(display.getWidth() / 2, display
.getHeight() / 2, 0));
// Assign the mouse to an input handler
am.registerWithInputHandler( input );
I think the problem is the last variable "input".
As this variable doesn't exist, I just created it myself, but I think I did something wrong...
InputHandler input;
Can anyone help me please?