Search in sources :

Example 6 with MouseAxisTrigger

use of com.jme3.input.controls.MouseAxisTrigger in project jmonkeyengine by jMonkeyEngine.

the class TestControls method simpleInitApp.

@Override
public void simpleInitApp() {
    // Test multiple inputs per mapping
    inputManager.addMapping("My Action", new KeyTrigger(KeyInput.KEY_SPACE), new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false));
    // Test multiple listeners per mapping
    inputManager.addListener(actionListener, "My Action");
    inputManager.addListener(analogListener, "My Action");
}
Also used : KeyTrigger(com.jme3.input.controls.KeyTrigger) MouseAxisTrigger(com.jme3.input.controls.MouseAxisTrigger)

Example 7 with MouseAxisTrigger

use of com.jme3.input.controls.MouseAxisTrigger in project jmonkeyengine by jMonkeyEngine.

the class TestWriteToTexture method simpleInitApp.

@Override
public void simpleInitApp() {
    initOpenCL1();
    tex = new Texture2D(settings.getWidth(), settings.getHeight(), 1, com.jme3.texture.Image.Format.RGBA8);
    Picture pic = new Picture("julia");
    pic.setTexture(assetManager, tex, true);
    pic.setPosition(0, 0);
    pic.setWidth(settings.getWidth());
    pic.setHeight(settings.getHeight());
    guiNode.attachChild(pic);
    initCounter = 0;
    flyCam.setEnabled(false);
    inputManager.setCursorVisible(true);
    inputManager.addMapping("right", new MouseAxisTrigger(MouseInput.AXIS_X, false));
    inputManager.addMapping("left", new MouseAxisTrigger(MouseInput.AXIS_X, true));
    inputManager.addMapping("up", new MouseAxisTrigger(MouseInput.AXIS_Y, false));
    inputManager.addMapping("down", new MouseAxisTrigger(MouseInput.AXIS_Y, true));
    inputManager.addMapping("drag", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
    inputManager.addListener(this, "right", "left", "up", "down", "drag");
    dragging = false;
}
Also used : Texture2D(com.jme3.texture.Texture2D) Picture(com.jme3.ui.Picture) MouseAxisTrigger(com.jme3.input.controls.MouseAxisTrigger) MouseButtonTrigger(com.jme3.input.controls.MouseButtonTrigger)

Aggregations

MouseAxisTrigger (com.jme3.input.controls.MouseAxisTrigger)6 KeyTrigger (com.jme3.input.controls.KeyTrigger)2 MouseButtonTrigger (com.jme3.input.controls.MouseButtonTrigger)2 Picture (com.jme3.ui.Picture)2 ChaseCameraAppState (com.jme3.app.ChaseCameraAppState)1 BitmapText (com.jme3.font.BitmapText)1 Rectangle (com.jme3.font.Rectangle)1 ActionListener (com.jme3.input.controls.ActionListener)1 AnalogListener (com.jme3.input.controls.AnalogListener)1 AmbientLight (com.jme3.light.AmbientLight)1 DirectionalLight (com.jme3.light.DirectionalLight)1 SpotLight (com.jme3.light.SpotLight)1 Material (com.jme3.material.Material)1 Geometry (com.jme3.scene.Geometry)1 LightNode (com.jme3.scene.LightNode)1 Node (com.jme3.scene.Node)1 Spatial (com.jme3.scene.Spatial)1 Grid (com.jme3.scene.debug.Grid)1 WireFrustum (com.jme3.scene.debug.WireFrustum)1 Box (com.jme3.scene.shape.Box)1