- Home /
How do I resize a sprite using the borders?
I have a sprite with a texture of a square with some borders (about 10px in each side) and I want to make it so that when I scale the box it will only resize the bit not in the borders, like it does in the UI. (This is not part of the UI) How would I do this?
Answer by Bioinformatizer · Sep 08, 2015 at 04:30 PM
To do this you need to use the nine slice type in the sprites settings.
Go to the image you imported and select the sliced option. From there drag the edges of the green lines in until they are just on the inside of the border you made. You sprite should now keep everything on the outside as a relatively static size and resize just the middle.
Doesn't work, I've tried this but it only works if I use it on something like a UI Image or UI Button.
Answer by Almakos · Feb 21, 2019 at 05:32 AM
Select your sprite and change Draw Mode to Sliced in the Inspector
Your answer
Follow this Question
Related Questions
Galaxy S to Galaxy Tab without resizing 1 Answer
My sprite is abnormally smaller in the scene 2 Answers
Sprites are pixelated after resizing 0 Answers