Advertisement
Anim8

loadTexture Class - Virtual Pet

Aug 3rd, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. package com.anim8.engine;
  2.  
  3. import java.io.File;
  4. import java.io.FileInputStream;
  5. import java.io.FileNotFoundException;
  6. import java.io.IOException;
  7.  
  8. import org.newdawn.slick.opengl.Texture;
  9. import org.newdawn.slick.opengl.TextureLoader;
  10.  
  11. public class loadTexture {
  12.      public Texture loadTexture(String key) {
  13.             try {
  14.                 return TextureLoader.getTexture("PNG", new FileInputStream(new File("assets/PNG/" + key + ".png")));
  15.             } catch (FileNotFoundException e) {
  16.                 e.printStackTrace();
  17.             } catch (IOException e) {
  18.                 e.printStackTrace();
  19.             }
  20.             return null;
  21.         }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement