2

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?

Glorfindel
  • 986
  • 1
  • 9
  • 16
iQew
  • 470
  • 4
  • 16

1 Answers1

3

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

Zibelas
  • 4,281
  • 2
  • 13
  • 22
  • 1
    I think you can adjust the Pixels per Unit setting to compensate for this. – DMGregory May 20 '20 at 11:37
  • 1
    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 – Zibelas May 20 '20 at 13:04
  • Using a smaller size for the RectTransform did work and also changing the Pixels per Unit worked! – iQew May 21 '20 at 10:25