public void setSelectedTile(File selectedTile) throws IOException {
		if(selectedTile.getParent().endsWith("autotiles")) {
			MapAutotile auto = new MapAutotile(ImageLoader.get().getSprite(selectedTile.getAbsolutePath()));
			tileName = selectedTile.getName();
			int frames = MapGridArray.isAnimatedTile(tileName.replaceFirst(".png", ""));
			if(frames > 1) {
				auto.setFrames(frames);
			}
			int w = auto.getDisplayTile().getWidth();
			int h = auto.getDisplayTile().getHeight();
			this.selectedTile = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
	        Graphics g = this.selectedTile.getGraphics();
	        g.drawImage(auto.getDisplayTile(), 0, 0, null);
	        autotiling = true;
		} else {
			BufferedImage img = ImageLoader.get().getSprite(selectedTile.getAbsolutePath());
			tileName = selectedTile.getName();
			int frames = MapGridArray.isAnimatedTile(tileName.replaceFirst(".png", ""));
			if(frames > 1) {
				img = img.getSubimage(0, 0, img.getWidth() / frames, img.getHeight());
			}
			int w = img.getWidth();
	        int h = img.getHeight();
	        this.selectedTile = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
	        Graphics g = this.selectedTile.getGraphics();
	        g.drawImage(img, 0, 0, null);
	        autotiling = false;
		}
	}