How do I make a JME app capture the mouse when the mouse is visible?

I used



MouseInput.get().setCursorVisible(true);



to display the mouse, but the mouse is not captured inside the JME app

u need to use either absolute mouse of relativeMouse. probably a seperate function to buildMouse().



load a texture on the absolute mouse and it'll be displayed.

How do you load a texture on the absolute mouse?  :?

skyuzo said:

How do you load a texture on the absolute mouse?

Sorry, I can’t find where absoluteMouse is…  :-o (Where is it???)



Edit: wait… I think I got it… now I feel dumb… lol thanks!



Edit: So how do you update and get the mouse moving?  :?



Edit: Ok I found the answer to my question… http://www.jmonkeyengine.com/jmeforum/index.php?topic=3515.0 thanks for helping  :smiley:

dont know which way u chose to use, but the MouseInput works just fine for me.



asign texture state and alpha state is the one i was talking about in the previous replies. it gives u a better control of the cursor. without doing any external work.



but if u prefer edit things in photoshop, i think the following should work just fine.


      // Create the Mouse object.
      mouse = new AbsoluteMouse("MyMouse", display.getWidth(), display.getHeight());
      mouse.registerWithInputHandler(input);
      
      // Give the mouse a new cursor.
      URL url = this.getClass().getClassLoader().getResource("Textures/cursor.png");
      MouseInput.get().setCursorVisible(true);
      MouseInput.get().setHardwareCursor(url);



this way u still get all the utilities that absoluteMouse provies, such as picking, but u cant edit the cursor like resize().

Alright I got my answer  :smiley: