nanos world API Reference Unofficial documentation
Function Client Moderate

Canvas:DrawText

Draws a Text on the Canvas<br/></br>This method can only be called from inside <code>Update</code> event<br/><br/>Shadow and Outline won't work properly with Transparent <code>clear_color</code>

Syntax

Lua
my_canvas:DrawText(text, screen_position, font_type = FontType.Roboto, font_size = 12, text_color = Color.WHITE, kerning = 0, center_x = false, center_y = false, shadow_color = Color.TRANSPARENT, shadow_offset = Vector2D(1, 1), outlined = false, outline_color = Color.BLACK)

Parameters

Name Type Default Description
text string — —
screen_position Vector2D — —
font_type optional FontType FontType.Roboto —
font_size optional integer 12 —
text_color optional Color Color.WHITE —
kerning optional float 0 —
center_x optional boolean false —
center_y optional boolean false —
shadow_color optional Color Color.TRANSPARENT —
shadow_offset optional Vector2D Vector2D(1, 1) —
outlined optional boolean false —
outline_color optional Color Color.BLACK —