So yeah, when can we expect to be able to control background repeat patterns? Similarly to repeat-x/repeat-y properties of css background-repeat.
It seems pretty easy to implement, it just require some uv calculation for rendered texture depending on the setting. The current options available for background cropping produces really terrible results on non-fixed rects.
It’s not on our immediate roadmap, which means unlikely to be implemented in the 2021 range.
That said, you can use the custom mesh UI Toolkit API to create your own mesh that does repeat its texture via your own UVs (which…you can then also animate). Here’s the documentation for that:
We need this too! The built-in 9-slice background is very limited and hey, any actual game needs custom borders right? Unless you go for an all out flat design but I’d still estimate some 75% of games need this.
Over a year later, any update? I’m not sure how this isn’t a high priority considering how many games I’d think need this (including mine). Does everyone make flat UI?
Hi, here’s a small update. There’s a pull request open and ready to merge that adds background-repeat, background-position and background-size properties.
ps: I think in the current version, there’s a sort of background-size property in the inspector, with 3 options (cover, contain etc). Each of these options is an icon. But hovering over the icon iirc just displays the unity property name, it doesnt display the value. It would be great to change that, so that we can know exactly what each icon does without trying to decipher what the icon looks like. Just a small request in case you agree it would be a good change.
Background repeating and scaling as mentioned above would be a huge help.
Having PPU controls of 9-slices is also essential.
Here on the Right you can see my uGUI canvas buttons, nice and tidy.
On the Left, you can see my UI Toolkit buttons. Same art, same 9-slices, same absolute pixel sizes – wildly different results.
The ability to set the Pixels Per Unit to control texil density would be a huge help. It seems the workaround up above is to use meshes to control this, but that’s a bit of a pain when it could, and should be right there in the options, like it was in the inspector for uGUI.
True. For now. That said, the UI Builder should not forget/reset/corrupt the style if you do manually use it in a StyleSheet. Meaning, if you just want to use it for one selector/element, just add it in a text editor and then continue using UI Builder for the rest of the work.
well thanks for nothing unity apparently the background-repeat is affected by the border radius. means, if you have a border radius and use background-repeat you will repeat an image clipped with a border radius…
that’s frustrating for a newbie starting with UI Toolkit