diff --git a/src/ei/engine/scene/Node.java b/src/ei/engine/scene/Node.java index 70445bf..33460a4 100644 --- a/src/ei/engine/scene/Node.java +++ b/src/ei/engine/scene/Node.java @@ -1,5 +1,6 @@ package ei.engine.scene; +import java.awt.Rectangle; import java.util.ArrayList; import org.lwjgl.opengl.GL11; @@ -76,7 +77,8 @@ public class Node extends Sprite { //Sets the location super.setTranslationGL(); //the rotation - //super.setRotationGL(texture.getImageWidth()/2,texture.getImageHeight()/2); + Rectangle rect = getBound(); + super.setRotationGL(rect.width/2,rect.height/2); //Sets the scale of the sprite super.setScaleGL(); @@ -112,4 +114,12 @@ public class Node extends Sprite { } return -1; } + + public Rectangle getBound(){ + Rectangle rect = new Rectangle(); + for(int i=0; i