Search Unity

Confirm Button for Slider Controls

Discussion in 'Immediate Mode GUI (IMGUI)' started by asethi, Dec 20, 2013.

  1. asethi

    asethi

    Joined:
    Jul 24, 2012
    Posts:
    16
    I have created a vertical slider, but finding it difficult to control the selected value from the slider. I want to create a confirm button to check whenever the player hits the slider value and once the user confirm it, using that slider value. Once the confirmed value has been used, making it to the default.

    I'm stuck at this particular situation, and can't proceed. Anybody there to help?
     
  2. dvidunis

    dvidunis

    Joined:
    Nov 5, 2010
    Posts:
    31
    Use something like this: (JS HERE)

    var final_output = 0;
    var temp_output = 0;

    temp_output = GUI.Slider(... ,temp_output);
    if(GUI.Button(... ,"confirm?")){
    final_output = temp_output;
    }
     
  3. asethi

    asethi

    Joined:
    Jul 24, 2012
    Posts:
    16
    Thanx dvdidunis.. I will try to execute this in the game, see if it works!!