How to keep sprite borders the same size when scaling a sprite in Unity?
I created an image in Photoshop to use as a sprite in Unity, and everything works fine as long as the sprite is scaled to X: 1; Y: 1.
The problem starts when I scale the image up when the border of the image stretches with the rest of the image. Is there a way to scale the image from its center, or ignore the border of the image when scaling?
Here's an example I can show:
The rectangle on top is the original image without scaling or downsizing, and the rectangle on the bottom is scaled in X: 5, Y: 0.5, but the borders are stretched.
I think the borders are stretched because part of the image and when it is scaled, the image (including the borders) is just stretched.
Is there a way to stretch the sprite image but ignore the borders?
source to share
You can use a sliced ββsprite. The center of the image is scaled to fit the control rectangle, but the borders remain sized regardless of scaling. Check out the Unity doc here: Unity - Manual: Image
source to share