Search Unity

Disable Gui Buttons while moving finger

Discussion in 'Immediate Mode GUI (IMGUI)' started by Tarzan111, Nov 22, 2014.

  1. Tarzan111

    Tarzan111

    Joined:
    Oct 8, 2014
    Posts:
    72
    Hi,
    I'm doing a vertical menu with few buttons (like scrabble app). Player can move his finger on the screen to scroll the all menu.

    I want to disable all click if the player is moving his finger, to avoid missclik.

    Thanks

    My script to catch finger moving
    Code (JavaScript):
    1. if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved) {
    2.             var touchDeltaPosition:Vector2 = Input.GetTouch(0).deltaPosition;
    3.             if(ynew<0.14*variable_global.scrhgt){
    4.                 ynew = ynew-touchDeltaPosition.y;
    5.             }
    6.         }