Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.anim8.engine;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- import org.newdawn.slick.opengl.Texture;
- import org.newdawn.slick.opengl.TextureLoader;
- public class loadTexture {
- public Texture loadTexture(String key) {
- try {
- return TextureLoader.getTexture("PNG", new FileInputStream(new File("assets/PNG/" + key + ".png")));
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement