optimized player model scaling

This commit is contained in:
2025-11-28 15:22:15 +01:00
parent d294d76ca5
commit a17ca8853c
3 changed files with 33 additions and 19 deletions

View File

@@ -0,0 +1,14 @@
package de.miaurizius.jgame2d.core;
import java.awt.image.BufferedImage;
public class Utility {
public static BufferedImage scaleImage(BufferedImage img, int width, int height) {
BufferedImage scl = new BufferedImage(width, height, img.getType());
scl = new BufferedImage(width, height, img.getType());
scl.createGraphics().drawImage(img, 0, 0, width, height, null);
return scl;
}
}