Tileset={}
function Tileset.new(fichier)
     local tile2=nil
     tile2={}
	 tile2.pic=Image.load(fichier)
	 
	 function tile2:blit(image,x,y,pos)
	     local l=20--tile2.pic:width()/3
		 local h=20--tile2.pic:height()/3
		 if pos==1 then  ----1
	         image:blit(x,y,tile2.pic,0,0,l,h)
		 elseif pos==2 then
		     image:blit(x,y,tile2.pic,l,0,l,h)
		 elseif pos==3 then
		     image:blit(x,y,tile2.pic,2*l,0,l,h)
		 elseif pos==4 then ------2
		     image:blit(x,y,tile2.pic,0,h,l,h)
		 elseif pos==5 then
		     image:blit(x,y,tile2.pic,l,h,l,h)
		 elseif pos==6 then
		     image:blit(x,y,tile2.pic,l*2,h,l,h)
		 elseif pos==7 then --------3
		      image:blit(x,y,tile2.pic,0,h*2,l,h)
		 elseif pos==8 then
		      image:blit(x,y,tile2.pic,l,h*2,l,h)
		 elseif pos==9 then
		      image:blit(x,y,tile2.pic,l*2,h*2,l,h)
		 end
	 end
     return tile2
end 