def __init__(self, text="", parent=None, x=0, y=0, size=10, align="left", color=None, may_change=False, font=None):
        """ Constructs a new text. The parameters are almost equal to the
        parameters of OnscreenText """
        RPObject.__init__(self)

        if color is None:
            color = Vec3(1)

        align_mode = TextNode.A_left

        if align == "center":
            align_mode = TextNode.A_center
        elif align == "right":
            align_mode = TextNode.A_right

        if font is None:
            font = Globals.font
            # Should always have a global font. Never use the default panda font!
            assert font

        self._initial_pos = Vec2(x, -y)
        self._node = OnscreenText(
            text=text,
            parent=parent,
            pos=self._initial_pos,
            scale=size,
            align=align_mode,
            fg=Vec4(color.x, color.y, color.z, 1.0),
            font=font,
            mayChange=may_change
        )
 Constructs a new text. The parameters are almost equal to the
        parameters of OnscreenText 
metadrive/render_pipeline/rpcore/gui/text.py