Libgdx 游戏 - 纹理缩放 [英] Libgdx Game - Texture Scaling

查看:35
本文介绍了Libgdx 游戏 - 纹理缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 LibGdx 为 Android 设备开发一个简单的游戏.我希望通过放大/缩小纹理来显示进度条.当我们进行缩放时,图像的形状会发生变化.您能否让我知道实现以下提到的场景的最佳方法.

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.

推荐答案

如果你想纯粹通过缩放来做,你可以做以下之一

If you want to do it purely by scaling, you can do one of the following

  • 在绿色位上使用掩码(例如使用蓝色部分作为掩码)
  • 将绿色部分切成三部分:两部分用于圆形端盖,另一部分用于可缩放的矩形中间部分.这样做的问题是,您可以显示的最小进度将是一个结尾.

这篇关于Libgdx 游戏 - 纹理缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆