Пример #1
0
 public Sprite(TextureLoader loader, String ref, int x, int y, int w, int h) {
   try {
     texture = loader.getTexture(ref, GL_TEXTURE_2D, GL_RGBA, GL_LINEAR, GL_LINEAR, x, y, w, h);
     width = texture.getImageWidth();
     height = texture.getImageHeight();
   } catch (IOException ioe) {
     ioe.printStackTrace();
     System.exit(-1);
   }
 }
Пример #2
0
 /**
  * Create a new sprite from a specified image.
  *
  * @param loader the texture loader to use
  * @param ref A reference to the image on which this sprite should be based
  */
 public Sprite(TextureLoader loader, String ref) {
   try {
     texture = loader.getTexture(ref);
     width = texture.getImageWidth();
     height = texture.getImageHeight();
   } catch (IOException ioe) {
     ioe.printStackTrace();
     System.exit(-1);
   }
 }