public void fillTiles(int layer, int x, int y){
		int tileSize = parent.tilePanel.getTileSize();
		
		int mouseX = x;
		int mouseY = y;
		
		if(mouseX > 0) mouseX = mouseX/tileSize;
		else mouseX = 0;
		
		if(mouseY > 0) mouseY = mouseY/tileSize;
		else mouseY = 0;
		
		int choice = parent.tilePanel.getChoice();
		
		if(choice >= 0 && choice < tiles.size()){
			if(tileID[layer][0].length > mouseY && tileID[layer].length > mouseX){
				fillCheck(layer, mouseX,mouseY,choice, -1);
			}
		}
		
		else{
			parent.error("Tile choice larger than tile vector.");
		}
		
		revalidate();
	}