Search Unity

Feature Request UXML source for built in Visual Elements

Discussion in 'UIElements' started by TheValar, Apr 17, 2019.

  1. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    754
    Unless I am missing something it looks like we can't access the UXML or default USS for the visual elements included in UIElements. If I wanted, for example, to make my own custom slider it would be nice if I could access the source for the built in slider to use as a starting point but currently I don't think this is possible. Are there any plans for having the prebuilt elements open sourced somewhere?
     
  2. jonathanma_unity

    jonathanma_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    61
    Hi,

    Currently you need to resort to using the UIElements debugger to inspect the styles.
    You can also add the same USS class as the default elements as a starting point and then easily override the styles to your needs.
     
    5argon likes this.
  3. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    754
    roger that thanks :)
     
  4. Leslie-Young

    Leslie-Young

    Joined:
    Dec 24, 2008
    Posts:
    1,042
    Would be great seeing this source to help in learning how to develop UIs that looks similar what exist currently. Thanks for tip on debugger though, will use that for now.
     
  5. jonathanma_unity

    jonathanma_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    61
    Thanks for the feedback, the default style sheets are generated at build time so it's not as simple as putting them on github.

    I agree it would be useful so I added a task to our backlog.