Change game directory

Add width and height to scale image

Signed-off-by: Chris Cromer <chris@cromer.cl>
This commit is contained in:
2019-09-29 18:50:27 -03:00
parent e38fca75b6
commit 15c713fed4
8 changed files with 14 additions and 11 deletions

View File

@@ -66,11 +66,13 @@ public class Animation implements Cloneable, Constantes {
* Scale an image
*
* @param image The image to scale
* @param width The new width
* @param height The new height
* @return Returns the scaled image
*/
static public BufferedImage scaleImage(BufferedImage image) {
Image tmp = image.getScaledInstance(16, 16, BufferedImage.SCALE_SMOOTH);
BufferedImage resized = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
static public BufferedImage scaleImage(BufferedImage image, int width, int height) {
Image tmp = image.getScaledInstance(width, height, BufferedImage.SCALE_SMOOTH);
BufferedImage resized = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = resized.createGraphics();
g2d.drawImage(tmp, 0, 0, null);
g2d.dispose();