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.
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.