Search Unity

Confusion: Whats the correct way to make Custom UI elements?

Discussion in 'Editor & General Support' started by welwordion, Oct 15, 2019.

  1. welwordion

    welwordion

    Joined:
    Jan 14, 2019
    Posts:
    9
    I really need an answer to this before I waste to much time with my current aproach. I wanted to change the behaviour and and visuals of a Slider. I made a new Graphic.class script and I could do this simple with game objects and the event System, but the Graphic class implementation has a horrible simplistic look and I do not get any of the features a normal slider provides. How am I supposed to do this without reinventing the wheel?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
    Slider in what framework? Is this for the Editor or player?

    Unity UI aka uGUI?
    IMGUI, e.g GUI.Label etc
    UIElements for Editor?

    If it's UGUI then you can just change the sprites to change the visual appearance.
     
  3. welwordion

    welwordion

    Joined:
    Jan 14, 2019
    Posts:
    9
    For the player and as far as I can tell all those frameworks force you to start from zero.
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
  5. welwordion

    welwordion

    Joined:
    Jan 14, 2019
    Posts:
    9
    Thx, I have not formulated my problem very precisely and my statement you have to start from zero was to broad.
    I want to color different parts of the fill different based on percentages of certain groups assigned to the same task, so I can not simply replace the sprite. After thinking for a while I will try to write a custom shader for the fill, override the ondrag for the handle, and the onpointerclick for fill and background.