def prepare_buffer(self):
        """ Prepares the target to render to an offscreen buffer """
        self._create_buffer()
        self._active = True
 Prepares the target to render to an offscreen buffer 
metadrive/render_pipeline/rpcore/render_target.py