Package com.jme.input

Examples of com.jme.input.AbsoluteMouse


  protected void buildInput() {
    // TODO this is sort of messy and out of order, TankInputHandler should be handled when creating tanks, or something
    input = new TankInputHandler((Tank) player.getControlledObject());

    // Create a new mouse. Restrict its movements to the display screen.
    mouse = new AbsoluteMouse("mouse", display.getWidth(), display
        .getHeight());

    // Center the mouse to begin with
    MouseInput.get().setCursorPosition(display.getWidth() / 2,
        display.getHeight() / 2);
View Full Code Here


        rootNode.attachChild(nodeRandomObjects);

        hud = new Hud();
        SceneMonitor.getMonitor().registerNode(hud, "HUD");

        AbsoluteMouse am = new AbsoluteMouse("am", DisplaySystem.getDisplaySystem().getWidth(), DisplaySystem.getDisplaySystem().getHeight());
        am.setRenderState(Tool.createUsualTS(HudTextures.MOUSE_CURSOR));
        am.setRenderState(Tool.createUsualBS());
        am.setSolidColor(Hud.defaultHudColor);
        hud.attachChild(am);
        hud.updateRenderState();

        cam.setFrustumPerspective(60.0f, (float) display.getWidth() / (float) display.getHeight(), 1, 5000);
        testCamera = DisplaySystem.getDisplaySystem().getRenderer().createCamera(display.getWidth(), display.getHeight());
        virtualHandler = new VirtualHandler(cam, hud.getControlCrossNode(), hud.getSpeedBarNode());

        input = new ShipInputHandler(virtualHandler);
        am.registerWithInputHandler(input);

        node = new CameraNode("cocpit", testCamera);
        SceneMonitor.getMonitor().registerNode(node, "COCKIP");

        node.setRenderQueueMode(Renderer.QUEUE_TRANSPARENT);
View Full Code Here

TOP

Related Classes of com.jme.input.AbsoluteMouse

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.