Sign In

$drawText[]

Draws a filled/stroked text on a canvas

v1.0.0+ Requires Brackets

Usage

$drawText[;;;;;;;;;;;;;]
Also callable as
$placeText $text $writeText

Arguments

NameTypeRequiredDescription
canvas
StringNoName of the canvas
type
YesThe text type
text
StringYesThe text to draw
font
StringYesThe text font following the `{size}px {font name}` format
style
StringYesThe style (color/gradient/pattern)
x
NumberYesThe text start X coordinate
y
NumberYesThe text start Y coordinate
maxWidth
NumberNoMaximum font width
multiline
BooleanNoIndicates if new lines should be allowed
wrap
NoIndicates how the text should be wrapped if it exceeds the maximum width
lineOffset
NumberNoThe text lines offset
newlineBeginning
NoThe alignment of the text when a new line is encountered
allowEmojis
BooleanNoIndicates if custom emojis should be drawn; Emojis get cached into preload://cache_emoji_{id}
break
StringNoA custom end of a wrapped line; None by default

Was this page helpful?