Libgdx Game - Texture Scaling

点点圈 提交于 2019-12-07 16:39:37

问题


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.

Scale up is fine..

Scale down is really a problem.


回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!