2
\$\begingroup\$

I am currently trying to slice a sprite for an Image component. It's a rectangle with rounded corners on the left side. Those rounded corners are supposed to stay the same even when the image is stretched while the rest of the rectangle is supposed to stretch dynamically horizontally and vertically. I will never stretch the image vertically, which is why that point can be ignored.

I setup 9-Slicing for the sprite like the documentation suggests, but the corners on the left side are still getting stretched. What am I doing wrong?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

It could be that you are trying to push the image smaller than the original. Zone D, E and F are used for resizing the image, but if you push it smaller than your buffer zones can provide, it has to resize the corners.

Your image looks like 512px height in the original and you try to display it at a new height of 100px

\$\endgroup\$
3
  • 1
    \$\begingroup\$ I think you can adjust the Pixels per Unit setting to compensate for this. \$\endgroup\$
    – DMGregory
    Commented May 20, 2020 at 11:37
  • 1
    \$\begingroup\$ Though that pixel per unit multiplier is something newer, i had it not in the 2019.1 version. Still if he want to has a crisp corner, I would rather make a new source image that is smaller, in this example with a corner radius of 50px instead of 250px \$\endgroup\$
    – Zibelas
    Commented May 20, 2020 at 13:04
  • \$\begingroup\$ Using a smaller size for the RectTransform did work and also changing the Pixels per Unit worked! \$\endgroup\$
    – iQew
    Commented May 21, 2020 at 10:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .