Canvas

Canvas Tutorials

Canvas Methods and Properties

HTML canvas fillText() Method

HTML canvas fillText() Method

 

 

The fillText() method is used to draw filled text on the canvas.

 

Default Value:-

 

Its default color is black.

 

Syntax:-

 

Its syntax is:- context.fillText(text, x, y, maxWidth);

 

Further Explanation:-

 

Parameter Description
text Specifies the text that will be written on the canvas
x The x-coordinate where to start painting the text.
y The y-coordinate where to start painting the text.
maxWidth Optional. The maximum allowed width of the text, in pixels

Code Explanation

All Tutorials related to Canvas Methods and Properties

All Sections related to Canvas