public Sprite getSprite(String ref) {
		if (sprites.containsKey(ref)) return sprites.get(ref);
		
		BufferedImage sourceImage;
		
		try {
			URL url = this.getClass().getClassLoader().getResource(ref);
			if (url == null) {
				System.out.println("Can't find: " + ref);
			}
			sourceImage = ImageIO.read(url);
			
			GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
			Image image = gc.createCompatibleImage(sourceImage.getWidth(),sourceImage.getHeight(),Transparency.BITMASK);
			
			image.getGraphics().drawImage(sourceImage, 0, 0, null);
			
			Sprite sprite = new Sprite(image);
			sprites.put(ref, sprite);
			return sprite;
		} catch(Exception e) {
			return null;
		}
	}