I want to animate UI elements, like HP bars, by moving and resizing them. How can I efficiently resize sprites every frame?
I am using the LibGDX framework.
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
When creating your texture, fill in the 2nd parameter to tell LibGDX to generate a mipmap chain:
Texture tex = new Texture(Gdx.files.internal("image.png"), true);
Then enable mipmapping in the texture filter:
This approach is hardware accelerated and there is no drawback to drawing the image at different sizes every frame.