generalized layer creation, get position at mouse pointer