Control UI Panel Border Size

Hi there,

I’m having trouble with the border size of UI panels. Below is an image of two panels next to each other. The one on the left is my panel, on the right is the default one produced by selecting GameObject->UI->Panel. The only difference between the two is that on mine I’ve set my own source image. I’ve also unselected “Fill Center” on both to show that, for some reason, the borders on my panel are about twice the size of the default one.

42083-snap1.png

The border is also much blurrier on mine than the default one. These two things are what I’m trying to get to the bottom of.

I’ve tried to make sure the settings on each panel match as well as possible both are 32x32 images with the same borders set up the same. I don’t see what else could effect the border sizes. Conceivably the blurring could be coming from my import settings on my texture which is why I included them in this image. Any suggestions would be welcome.

I realise this is an old question. But I had the same problem and was hoping for an answer here. I figured it out in the meantime. So I’m just posting this here for the ppl after me.

In your sprite texture, you need toy around with the “Pixels Per Unit” value. Higher values make your border thinner / more compact / less blurry. In your screenshot it has the value ‘100’. You should it increase it to 200 or 300 for a similar border thickness as the Unity panel border.