Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Radial filling

Discussion in 'UI Toolkit' started by OMGOMGXAXA, Jul 12, 2021.

  1. OMGOMGXAXA

    OMGOMGXAXA

    Joined:
    Apr 2, 2016
    Posts:
    10
    I need radial filling for my game. In order to have a button with time completion. Is it possible to achieve it with UI Builder ?

    For example, a button like this one :
    upload_2021-7-12_10-46-34.png
     

    Attached Files:

  2. AlexandreT-unity

    AlexandreT-unity

    Unity Technologies

    Joined:
    Feb 1, 2018
    Posts:
    389
    We don't have any styling that allows to create radial visuals like this. You could create a VisualElement that generates a custom mesh to display the border. See VisualElement.GenerateVisualContent.

    On 2022.1 we're working on a vector API that could create an actual mesh border, but in the meantime a texture could work.
     
    Last edited: Jul 12, 2021
    OMGOMGXAXA likes this.