根据开始和结束位置缩放纹理

Scale Texture based on the start and end position

在我基于 LibGdx 的游戏中,我需要从开始位置到结束位置缩放图像。结束位置随着时间的推移而变化。因此图像必须根据结束位置进行缩放。

你能帮我根据开始和结束位置缩放纹理吗?

如果您将 Scene2D 与舞台和演员一起使用,则可以使用您的纹理和

创建Image actor
myImageActor.setBounds(startX, startY, widthFromMyEndPosition, heightFromMyEndPosition)

或者,您可以按同样的方式使用spriteBatch.draw(Texture texture,float x,float y,float width, float height)