How to resize a sprite in Libgdx?

て烟熏妆下的殇ゞ 提交于 2019-11-30 08:14:55
Wazani

The problem was solved.

I had to use sprite.draw(batch); instead of using Batch.draw(Sprite sp, float x, float y); since the Batch.draw(...) method takes the texture from the passed sprite and uses the texture in the drawing process which has a fixed width and a fixed height.

Another way to solve this problem is to use the batch.draw(Sprite, float x, float y, float width, float height); method in the SpriteBatch class.

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