Click on a sprite in the menu and set a variable to a certain value which relates to that sprite, i.e. if you clicked the grass then set var to 1, if you clicked path then set var to 2. Then on mouse clicked, check that variable and create the object.
Oh cool, thanks! But just wondering, what if I wanted keep the objects from overlapping?