What is the ideal way to set up 9-slicing?
(for the people who don't know what 9-slicing is)
Let's say we have a quad, with a texture applied to it. 9-slicing is basically a way of dividing a texture in 9 parts. The reason why we do this is to have a quad with a texture, that can be resized without the issue of having the texture all warped. we divide the edges, the corners, and the main body of the texture:
As can be seen in the pictures, we have a quad that can be scaled without warping the texture
which would look something like this(no 9-slicing):
Now, to come back to my question: How should i set up 9-slicing? should i have a multiple quads(one for the center part, one for the right edge, one for the left edge....) but then how do i specify the different texture coordinates for each quad? Another way would be to just create the quads with their texture coordinates and relative textures and then move them all toghether like a whole object. I hope someone explain me a little more about this "9 slicing" approach, since I've never used it before. Thanks everyone for the help
EDIT: (to answer HolyBlackCat)
"Another way would be to just create the quads with their texture coordinates and relative textures and then move them all toghether like a whole object."
What i wanted to say is this: I create separate quads, attach separate textures to them, render and move them at the same time:
This is, in my opinion, the most logical way to do this. Despite that, I still want to know what would be a better, faster way to do this, without having to have too many vertices for a quad