code: def _updateImage(self):
          
          # Fill the background of the image
          if self.backgroundColor is not None:
              self.textImage.fill(self.backgroundColor)
  
          # Render the text as a single line, and blit it onto the textImage surface
          if self.mask is None:
              lineSurface = self.font.render(self.text, True, self.textColor)
          else:
              nChars = len(self.text)
              maskedText = self.mask * nChars
              lineSurface = self.font.render(maskedText, True, self.textColor)
          self.textImage.blit(lineSurface, (0, 0))
docs: Internal method to render text as an image.