Search Unity

UI Dial - Question

Discussion in 'Immediate Mode GUI (IMGUI)' started by keiranlovett, Nov 9, 2014.

  1. keiranlovett

    keiranlovett

    Joined:
    May 9, 2013
    Posts:
    16
    How could one create a dial - a circular button that can be rotated on drag to adjust a value. Has anyone figured this out yet. So far I've attempted to convert the mouse position to the button transform rotation but to no success.
     
  2. Cpt Chuckles

    Cpt Chuckles

    Joined:
    Dec 31, 2012
    Posts:
    86
    i would get the mouse delta since last frame (either x or y depending on whether you want to turn it by moving horizontally or vertically) and add that to the rotation as degrees