Phase Transition in A Self-Gravitating Planar Gas