Confinement-deconfinement transitions for two-dimensional Dirac particles