问题
I am using LibGdx to develop a simple game for Android devices. I wish to show a progress bar using the Texture by scaling it up / down. When we do scaling the image is changing in its shape. Could you please let me know a best approach to achieve the below mentioned scenario.



回答1:
If you want to do it purely by scaling, you can do one of the following
- Use a mask on the green bit (use for example the blue part as a mask)
- Chop the green part up in three parts: two for the round end caps and a rectangular middle piece you can scale. The problem with this is that the smalles progress you can display will be one endcap.
来源:https://stackoverflow.com/questions/28825128/libgdx-game-texture-scaling