fillText - method of the CanvasCtx object
Draws filled text.
The default color is black.
Object fillText(String text, Long x, Long y, [Long maxWidth])
|text||(String) Text to be written|
|x||(Long) The x-coordinate of the text drawing|
|y||(Long) The y-coordinate of the text drawing|
|maxWidth||[optional] (Long) The maximum allowed width of the text (in pixels).|
This method is also functional in Web panels
. If the text contains a "new line" character then in local application the text will be multi-row, but stays single-row on the Web. In order to maintain Web and future versions compatibility, "new line" character usage it is not recommended.
variable represents the drawing canvas (CanvasCtx
). The setup is done on the "Draw
" tab at the beginning of the script of drawing event onDraw
ctx.fillStyle = "blue";
ctx.fillText("Promotic", 50, 20);