I'm hoping someone knows how

Discussion in 'Mod Discussions' started by killerkiwijuice, July 31, 2014.

  1. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    I made a thread in general discussion about a touchscreen interface.

    It would actually fit very well with the current UI.

    Anyway i'm hoping someone that knows anything about mods can point me in the right direction for developing touchscreen movements for windows 8 tablets (if this is even possible), like my Surface pro 3.

    Thanks!

    EDIT: i forgot to mention gesture control, like pinch to zoom and 2 finger swipe to pan, for example.
    Last edited: August 1, 2014
  2. someonewhoisnobody

    someonewhoisnobody Well-Known Member

    Messages:
    657
    Likes Received:
    361
    I do not know if Uber has given us the modding hooks for moving the camera yet. It would be an issue if they haven't.
  3. sycspysycspy

    sycspysycspy Active Member

    Messages:
    268
    Likes Received:
    80
    It sounds nice but not practical, PA also relies on keyboard a lot.
  4. ozonexo3

    ozonexo3 Active Member

    Messages:
    418
    Likes Received:
    196
    I talked about that half year ago, and then everyone sayd just "No!". I will also want to see it working with touchscreens, but this will not be ready fast. This is realy not so important feature.
  5. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    media/ui/main/shared/js/api/camera.js

    especially api.camera.{zoom, roll, pan}

    Search for "browser touch events" or something to that effect; Coherent has Android versions so it may be included.
  6. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Thanks! I opened up the script and found the zoom, pan, and roll functions. I also found javascript touch events here: http://www.javascriptkit.com/javatutors/touchevents.shtml

    I've been looking at some tutorials on jscript (i'm more familiar with C#) but none of them deal with camera navigation. I'm not sure what to do right now but i'll probably figure it out. I'll keep this updated!

    here's the script for reference:

    function init_camera(api) {

    var camera_pan_speed_factor = 1.0;
    var camera_zoom_speed_factor = 1.0;

    api.camera = {
    alignToPole: function() { engine.call('camera.alignToPole'); },

    changeKeyPanSpeed: function (factor) {
    console.log(factor);
    camera_pan_speed_factor += factor;
    camera_pan_speed_factor = (camera_pan_speed_factor < 0.01) ? 0.01 : camera_pan_speed_factor;
    engine.call('set_camera_key_pan_speed', camera_pan_speed_factor);
    },

    focusPlanet: function (index) { engine.call('camera.focusPlanet', typeof (index) === 'number' ? index : 0); },
    maybeSetFocusPlanet: function () { engine.call('camera.maybeSetFocusPlanet'); },

    freeze: function (enable) { engine.call('camera.freeze', enable) },
    lookAt: function (target) {
    if (typeof (target) === 'object')
    target = JSON.stringify(target);
    if (typeof (target) === 'string')
    engine.call('camera.lookAt', target);
    },

    captureAnchor: function (anchor) { engine.call('camera.captureAnchor', typeof (anchor) === 'number' ? anchor : 0); },
    recallAnchor: function (anchor) { engine.call('camera.recallAnchor', typeof (anchor) === 'number' ? anchor : 0); },

    setAllowZoom: function (enable) { engine.call('camera.setAllowZoom', enable); },
    setZoom: function (zoom) { return engine.call('camera.setZoom', typeof (zoom) === 'string' ? zoom : ''); },
    zoom: function (zoomDelta) { engine.call("camera.zoom", zoomDelta); },

    setAllowRoll: function (enable) { engine.call('camera.setAllowRoll', enable); },
    roll: function (rollDelta) { engine.call("camera.roll", rollDelta); },

    setAllowPan: function (enable) { engine.call('camera.setAllowPan', enable); },
    pan: function (deltaX, deltaY) { engine.call("camera.pan", deltaX, deltaY); },


    track: function (enable) { engine.call('camera.track', typeof (enable) === 'boolean' ? enable : false); },
    setMode: function (mode) { return engine.call('camera.setMode', typeof (mode) === 'string' ? mode : ''); }
    };
    };
    init_camera(window.api);

Share This Page