def get_text_obj(reference_rect, offset, text):
    """Create and return customized text object."""
    ### define text
    text += ":"

    ### define position data

    coordinates_name = "topleft"
    coordinates_value = reference_rect.move(offset).topleft

    ### create and return text obj

    text_obj = Object2D.from_surface(
        surface=render_text(
            text=text,
            font_height=FONT_HEIGHT,
            padding=5,
            foreground_color=WINDOW_FG,
            background_color=WINDOW_BG,
        ),
        coordinates_name=coordinates_name,
        coordinates_value=coordinates_value,
    )

    return text_obj
Create and return customized text object.
nodezator/editing/widgetpicker/subforms.py