HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Canvas Object : Write "Hello world!" and "Big smile!" (with gradient) on the canvas, using fillText()
The numbers in the table specify the first browser version that fully supports the method.
Method | |||||
---|---|---|---|---|---|
fillText() | 4.0 | 9.0 | 3.6 | 4.0 | 10.1 |
The fillText() method draws filled text on the canvas. The default color of the text is black.
JavaScript syntax: | context.fillText(text, x, y, maxWidth); |
---|
Parameter | Description | Play it |
---|---|---|
text | Specifies the text that will be written on the canvas | Play it » |
x | The x coordinate where to start painting the text (relative to the canvas) | Play it » |
y | The y coordinate where to start painting the text (relative to the canvas) | Play it » |
maxWidth | Optional. The maximum allowed width of the text, in pixels | Play it » |
❮ Canvas Object