I want to use a menu image for short and long menus, when I scale the image the edges look bad. Is it possible to scale only middle part of a sprite or is there a way to do what I want?
Thanks for you help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to use a technique called 9 Slice Scaling. It involves slicing the image into 9 slices so that only the middle part scales in both directions, where as the edges only scale up/down or left/right to preserve them.
There is an open source implementation on GitHub which I use and it works well.