Change game directory

Add width and height to scale image

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

1
.idea/.name Normal file
View File

@ -0,0 +1 @@
Azaraka

View File

@ -2,11 +2,11 @@
<artifact type="jar" name="Azaraka:jar"> <artifact type="jar" name="Azaraka:jar">
<output-path>$PROJECT_DIR$/out/artifacts/Azaraka_jar</output-path> <output-path>$PROJECT_DIR$/out/artifacts/Azaraka_jar</output-path>
<root id="archive" name="Azaraka.jar"> <root id="archive" name="Azaraka.jar">
<element id="module-output" name="Game" /> <element id="module-output" name="Azaraka" />
<element id="directory" name="javadoc"> <element id="directory" name="javadoc">
<element id="dir-copy" path="$PROJECT_DIR$/javadoc" /> <element id="dir-copy" path="$PROJECT_DIR$/../Azaraka/javadoc" />
</element> </element>
<element id="extracted-dir" path="$PROJECT_DIR$/lib/gson-2.8.5.jar" path-in-jar="/" /> <element id="extracted-dir" path="$PROJECT_DIR$/../Azaraka/lib/gson-2.8.5.jar" path-in-jar="/" />
</root> </root>
</artifact> </artifact>
</component> </component>

View File

@ -1,10 +1,10 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="lib"> <library name="lib">
<CLASSES> <CLASSES>
<root url="file://$PROJECT_DIR$/lib" /> <root url="file://$PROJECT_DIR$/../Azaraka/lib" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/../Azaraka/lib" recursive="false" />
</library> </library>
</component> </component>

View File

@ -6,6 +6,6 @@
<option name="OPEN_IN_BROWSER" value="false" /> <option name="OPEN_IN_BROWSER" value="false" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8 Oracle" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8 Oracle" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/../Azaraka/out" />
</component> </component>
</project> </project>

View File

@ -2,7 +2,7 @@
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/Game.iml" filepath="$PROJECT_DIR$/Game.iml" /> <module fileurl="file://$PROJECT_DIR$/../Azaraka/Azaraka.iml" filepath="$PROJECT_DIR$/../Azaraka/Azaraka.iml" />
</modules> </modules>
</component> </component>
</project> </project>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="$PROJECT_DIR$/../Azaraka" vcs="Git" />
</component> </component>
</project> </project>

View File

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