make it possible to generte tile map according to an existing texture.