Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Allow 9-sliced images in custom UI#292

Currently, providing an image to eg. a button from custom assets will uniformly stretch the image to match the button’s proportions, causing ugly stretching and even warping.

Unity has a different option for stretching textures “Sliced”, where the edges of the image are kept the same and only the middle is stretched, based on margins defined in the associated sprite asset. This is what the default buttons, inputFields, etc use. XmlLayout even has an option to enable this in XML: type="Sliced". But we can’t import sprites to custom assets, only raw images, so we cant define out margins

My suggestion would be either
A. allow some system of importing sprites into UI assets, or
B. add some custom xml attribute like sliceMargins so that these can be defined in markup.

IMO This is probably the single thing that would go the longest way to improving custom UI (besides significant refactors)

3 years ago
Changed the status to
Research
3 years ago
B
Changed the status to
Planned
3 years ago
B
Changed the status to
In Progress
3 years ago
Changed the status to
Completed
2 years ago