Package com.jme3.input.controls

Examples of com.jme3.input.controls.MouseButtonTrigger


    super.initialize(stateManager, app);
    tuioInput = TuioInput.get();
    tuioInput.addListener(this);
    BitmapFont guiFont = app.getAssetManager().loadFont("Interface/Fonts/Default.fnt");
   
    BitmapText tuioStatsLabel = new BitmapText(guiFont, false);
        tuioStatsLabel.setLocalTranslation(0, tuioStatsLabel.getLineHeight()*3, 0);
        tuioStatsLabel.setText("Tuio Input:");
        tuioStatsNode.attachChild(tuioStatsLabel);
   
        tuioStatsText = new BitmapText(guiFont, false);
        tuioStatsText.setLocalTranslation(80, tuioStatsText.getLineHeight()*3, 0);
        tuioStatsText.setText("");
        tuioStatsNode.attachChild(tuioStatsText);
       
        tuioStatsText2 = new BitmapText(guiFont, false);
        tuioStatsText2.setLocalTranslation(80, tuioStatsText2.getLineHeight()*2, 0);
        tuioStatsText2.setText("");
        tuioStatsNode.attachChild(tuioStatsText2);
  }
View Full Code Here


  public void initialize(AppStateManager stateManager, Application app) {
    super.initialize(stateManager, app);
    //cam = app.getCamera();
    assetManager = app.getAssetManager();
        guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
        fpsText = new BitmapText(guiFont, false);
        fpsText.setLocalTranslation(0, fpsText.getLineHeight(), 0);
        fpsText.setText("Frames per second");
        //camText = new BitmapText(guiFont, false);
        //camText.setLocalTranslation(0, camText.getLineHeight()*5, 0);
        //camText.setText("Cam: ");
View Full Code Here

     * Attaches FPS statistics to guiNode and displays it on the screen.
     *
     */
    public void loadFPSText() {
        guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
        fpsText = new BitmapText(guiFont, false);
        fpsText.setLocalTranslation(0, fpsText.getLineHeight(), 0);
        fpsText.setText("Frames per second");
        guiNode.attachChild(fpsText);
    }
View Full Code Here

    guiNode.detachChildNamed("Statistics View");

    camNode = new Node("Cam Node");

    flyCam.setEnabled(false);
    ChaseCamera chaseCam = new ChaseCamera(cam, camNode, inputManager);
    chaseCam.setSmoothMotion(true);
    chaseCam.setMaxDistance(100000);
    chaseCam.setMinVerticalRotation(-FastMath.PI / 2);

    rootNode.attachChild(camNode);

  }
View Full Code Here

        keyInput = context.getKeyInput();
        if (keyInput != null)
            keyInput.initialize();

        joyInput = null;
        inputManager = new InputManager(mouseInput, keyInput, joyInput);
       
        // init Input TUIO ----------------------------------
        //initTuio();

       
View Full Code Here

            //flyCam = new FlyByCamera(cam);
            //flyCam.setMoveSpeed(1f);
            //flyCam.registerWithInput(inputManager);

            if (context.getType() == Type.Display) {
                inputManager.addMapping("SIMPLEAPP_Exit", new KeyTrigger(KeyInput.KEY_ESCAPE));
            }
          
            inputManager.addMapping("SIMPLEAPP_CameraPos", new KeyTrigger(KeyInput.KEY_C));
            inputManager.addMapping("SIMPLEAPP_Memory", new KeyTrigger(KeyInput.KEY_M));
            inputManager.addListener(actionListener, "SIMPLEAPP_Exit",
                    "SIMPLEAPP_CameraPos", "SIMPLEAPP_Memory");
        }
   
        //create the Core
View Full Code Here

        super.setSpatial(spatial);

        if (spatial != null) {
            initialRotation = spatial.getLocalRotation().clone();

            inputManager.addMapping(LEFT_CLICK, new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
            inputManager.addListener(actionListener, LEFT_CLICK);

            weaponEntity = ((WeaponEntity) spatial.getUserData("entity"));
        }
    }
View Full Code Here

    private Camera cam = myApp.getCamera();
    private InputManager inputManager = myApp.getInputManager();
    private String LEFT_CLICK = "leftFood";

    public FoodThrowControl() {
        inputManager.addMapping(LEFT_CLICK, new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
        inputManager.addListener(this, LEFT_CLICK);
    }
View Full Code Here

   */
  private TuioInput() {}
 
  public void setInputManager(InputManager inputManager) {
    this.inputManager = inputManager;
    inputManager.addMapping("MouseToTuio_Active", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
    inputManager.addListener(this, "MouseToTuio_Active");
    inputManager.addMapping("MouseToTuio_Right_Active", new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
    inputManager.addListener(this, "MouseToTuio_Right_Active");
    inputManager.addMapping("SIMPLEAPP_Zoom", new KeyTrigger(KeyInput.KEY_UP));
    inputManager.addListener(this, "SIMPLEAPP_Zoom");
        inputManager.addMapping("SIMPLEAPP_ZoomMin", new KeyTrigger(KeyInput.KEY_DOWN));
        inputManager.addListener(this, "SIMPLEAPP_ZoomMin");
View Full Code Here

  }

  @Override
  public void addKeyMapping(InputManager man) {
    this.inputManager = man;
    man.addMapping("GotoClickedInputAction", new MouseButtonTrigger(
        MouseInput.BUTTON_LEFT));
    man.addListener(this, "GotoClickedInputAction");
  }
View Full Code Here

TOP

Related Classes of com.jme3.input.controls.MouseButtonTrigger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.