optimized player model scaling
This commit is contained in:
14
src/de/miaurizius/jgame2d/core/Utility.java
Normal file
14
src/de/miaurizius/jgame2d/core/Utility.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user