A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'UIElements' started by TextusGames, Oct 7, 2019.
Is there a way?
We have the Image element for this but the UIBuilder does not currently support this element. You'd have to add it in code. You can use a dummy VisualElement in the UIBuilder to mark where the Image element should go and then it should be pretty easy to swap it in C#. This is a temporary issue.
But I'd encourage you to try not using auto-sizing elements for your images. It means that some of your layout is not described in USS but instead it comes from a random file. If you resave your image with a different size, you can break your UI's layout without knowing. It's usually better to have the UI drive the size of the images it uses. But I say this without knowing your exact use case.