This is a big commit. Added mouse cursors and a load bar. Started whit the game. and many many other things
This commit is contained in:
parent
448fca2fdf
commit
4e7722fedb
34 changed files with 597 additions and 95 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package ei.engine.scene;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import ei.engine.texture.Texture;
|
||||
|
|
@ -74,10 +76,14 @@ public class Sprite extends Entity {
|
|||
return texture.getImageHeight();
|
||||
}
|
||||
|
||||
protected void bindTexture(){
|
||||
|
||||
/**
|
||||
* Returns the texture
|
||||
* @return The texture
|
||||
*/
|
||||
public Texture getTexture(){
|
||||
return texture;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Draw the sprite
|
||||
*/
|
||||
|
|
@ -85,14 +91,12 @@ public class Sprite extends Entity {
|
|||
// store the current model matrix
|
||||
GL11.glPushMatrix();
|
||||
|
||||
//Sets the scale of the sprite
|
||||
super.setScaleGL();
|
||||
//Sets the location
|
||||
super.setTranslationGL();
|
||||
//the rotation
|
||||
super.setRotationGL();
|
||||
//and sets back the rotation so that the rotation pivot is the center of the sprite
|
||||
super.setTranslationGL(-texture.getImageWidth()/2,-texture.getImageHeight()/2,0);
|
||||
super.setRotationGL(texture.getImageWidth()/2,texture.getImageHeight()/2);
|
||||
//Sets the scale of the sprite
|
||||
super.setScaleGL();
|
||||
|
||||
// bind to the appropriate texture for this sprite
|
||||
texture.bindGL();
|
||||
|
|
@ -120,4 +124,15 @@ public class Sprite extends Entity {
|
|||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bound of this class
|
||||
*/
|
||||
public Rectangle getBound() {
|
||||
return new Rectangle(
|
||||
(int)getLocation().getX(),
|
||||
(int)getLocation().getY(),
|
||||
texture.getImageWidth(),
|
||||
texture.getImageHeight());
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue