- Home /
The question is answered, right answer was accepted
What makes the default Panel background image tick?
Been looking far and wide for an answer to this, but can't find anything for my question specifically so here we go.
Among Unity's default assets is 32x32 pixels png file simply named "background". When you select this image as the source image to a UI Panel, it will adjust to any rectangular shape by keeping the corners intact, and then either stretching or tiling the middle and edge pieces (unsure). I can see in the texture preview that the image has been spliced into 9 parts, which makes perfect sense. I'm however unable to replicate this effect with an image of my own.
Could someone walk me through the process of setting up a custom image this way?
Answer by Bikupan · Jun 11, 2018 at 07:49 AM
Nevermind. Naturally I stumble on an answer right after I post. Closing the thread. If anyone else stumbles on this, here ya go: https://docs.unity3d.com/Manual/9SliceSprites.html
Good job finding out yourself and documenting it! :)
You could accept your own answer.
Follow this Question
Related Questions
[4.6] Auto grow/shrink a panel to fit its contents 2 Answers
Using iTween with the new Unity UI 2 Answers
UI: Creating UI based on many strings 0 Answers
Moving a UI panel in front of other UI elements without using sibling commands 1 Answer
How to hide UI canvas between scenes,UI Panel staying visible between scenes 1 Answer