update README for JavaScript
This commit is contained in:
14
code/JavaScript/Canvas/drawText.js
Normal file
14
code/JavaScript/Canvas/drawText.js
Normal file
@@ -0,0 +1,14 @@
|
||||
function Draw() {
|
||||
let context = document.getElementById('canvas').getContext('2d');
|
||||
|
||||
// Styling text
|
||||
// font = value
|
||||
// textAlign = value | *start, end, left, right, center
|
||||
// textBaseline = value | top, hanging, middle, *alphabetic, ideographic, bottom
|
||||
// direction = value | ltr, rtl, *inherit
|
||||
|
||||
// fillText(text, x, y [, maxWidth])
|
||||
// strokeText(text, x, y [, maxWidth])
|
||||
context.font = '48px serif';
|
||||
context.fillText('Hello world', 10, 50);
|
||||
}
|
||||
Reference in New Issue
Block a user