How to make edges of a sprite, UI not stretch

Hello! So I’ve been googleling my question around but it seems I can’t find the answer. My question is how do I do something like the sprites for the default UI since I see they have these tick lines . Yes so I just want to have a custom UI skin that stretches nicely.

bla

I think you what you are talking about is slicing, with a 9 part grid where only the center is stretched if you stretch the entire sprite.

-Click on the image you have imported into project folder.

-In the inspector

-Select the “Texture Type” as “Sprite 2D & UI”.

-Click on the Sprite editor button. A new window opens up.

-On the each edge of the sprite you can re-align the green edge[Border] of the sprite as you want.

-Hit “apply” button on the top right corner near the close button of the Sprite editor.

-You can close the window now.

-Now if you create a new UI image you can select the image type as “Sliced”.
alt text

-Now you can retain your edges of the sprite.

Hope this helped.
:slight_smile: