Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How do you make a knob?

Discussion in 'UGUI & TextMesh Pro' started by PSpiroz, Feb 11, 2017.

  1. PSpiroz

    PSpiroz

    Joined:
    Feb 15, 2015
    Posts:
    21
    I am trying to find a simple "knob" but I cannot find any documentation or any thread on this.
    There is this UI.DefaultControls.Resources-knob that is a sprite as it says, and I can understand that having a slider or two (one vertical / one horizontal ) affecting the same value, with a rotated circular sprite would have almost /or near the same "see 'n' feel" of a knob, but is this the way to have one?
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @PSpiroz

    hi there,

    AFAIK there is no rotating knob which you can turn.

    But if you need to create one, it's possible.

    Calculate the direction of press compared to your UI sprite or button, then calculate angle and use it to rotate your UI sprite around.
     
  3. PSpiroz

    PSpiroz

    Joined:
    Feb 15, 2015
    Posts:
    21
    SimonDarksideJ likes this.
  4. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,685
    Beat me to it @PSpiroz
    Yes, the UIKnob control was added to the UI Extensions project a while ago. You may also like the Radial Layout if you like things going round and round :D