CanvasItem.drawString

Draws text using the specified font at the position (bottom-left corner using the baseline of the font). The text will have its color multiplied by modulate. If clip_w is greater than or equal to 0, the text will be clipped if it exceeds the specified width. Example using the default project font:

More...
struct CanvasItem
@nogc nothrow
void
drawString
(,
in Vector2 position
,
in String text
,
in Color modulate = Color(1, 1, 1, 1)
,
in long clip_w = -1
)

Detailed Description

# If using this method in a script that redraws constantly, move the # default_font declaration to a member variable assigned in _ready() # so the Control is only created once. var default_font = Control.new().get_font("font") draw_string(default_font, Vector2(64, 64), "Hello world")

See also Font.draw.

Meta