CanvasContext.fillText

Fill the text in the canvas.

Parameters

It is Object type.

FieldTypeDescription
textStringText
xNumberThe x coordinate of left-bottom corner of text
yNumberThe y coordinate of left-bottom corner of text

Sample Code

copy
//.js
const ctx = my.createCanvasContext('awesomeCanvas')

ctx.setFontSize(42)
ctx.fillText('Hello', 30, 30)
ctx.fillText('alipay', 200, 200)

ctx.draw()