Сircular filling


Hello. Please tell me how to make a circular filling of a circle, implemented either through the border (as in the screenshot), or if a picture is inserted.

Unity 2023.2

That will require code, which uses the same Vector API drawing that normal borders use.

We have an example to get you started.

1 Like

Thanks a lot

Please explain what the “new CustomStyleProperty” does

This is a custom USS style property. From the manual:

You can absolutely ignore custom USS properties and just use a normal Color attribute property that is exposed to UXML, this way it will also show up in the UI Builder. You just don’t get the benefits of style sheets.

This feature is very cool because I don’t want to create multiple selector variations for the same color in order to use it for background, image tint or so on. Therefore, I have already figured out how to make a custom style. It’s a pity, of course, not to see the color in the editor, but Rider draws the color in the code.

Did I decide to use it correctly, or are there easier ways?

Using something like Rider is easy as it gets currently

1 Like

Thanks

How to solve the purely visual problem that elements that are assigned a color through a custom selector become invisible when inactive. They are drawn only if you click on them.