Clicking on pics in MenuState

I am wondering how to "select" a pic in the menustate, I am still very new to both java and jME. Here are some of my attemts:



public class BGMainMenuState extends StandardGameState {
   
   private Node cursor;
   private DisplaySystem display;
   private InputHandler input;
   private Mouse mouse27;
   private Quad hudQuad27;
   private Quad hudQuad1;
   private Text text25;
   private Vector3f mousecoord;
   //private Vector3f mousecoord1;
   private Vector3f newgamepicvec;
   
   public BGMainMenuState(String name) {
      super(name);

      display = DisplaySystem.getDisplaySystem();
      display.getRenderer().setBackgroundColor(ColorRGBA.blue);

      initInput();
      initCursor();
      initText();
      initHud();
      initHudSettings();

      rootNode.setLightCombineMode(LightState.OFF);
      rootNode.setRenderQueueMode(Renderer.QUEUE_ORTHO);
      rootNode.updateRenderState();
      rootNode.updateGeometricState(0, true);
   }
   
   /**
    * @see com.jmex.game.state.StandardGameState#onActivate()
    */
   public void onActivate() {
      display.setTitle("ScarBaseGame - MainMenuState");
      super.onActivate();
   }
   
   protected void initInput() {
      input = new BGMainMenuHandler( this );

Not sure if this is what you are looking for, but maybe you could just use texture quads with mouse pick instead of hud (if you only need buttons). hope this helps

Your HUD is ortho mode so you probably don't need a ray to find the button picking. Just compare your quad sizes with the absolute mouse coords. This isn't real code but the general idea is something like:



   MouseInput m = MouseInput.get();
   // if mouse button pressed ...
   float mx = m.getXAbsolute();
   float my = m.getYAbsolute();
   // see if it hit hudBtn
   float x0 = hudBtn.getWorldTranslation().x;
   float y0 = hudBtn.getWorldTranslation().y;
   float x1 = x0 + btnWidth;
   float y1 = y0 + btnHeight;
   if (mx >= x0 && mx <= x1 && my >= y0 && my < y1) {
      // hit
   }