File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,20 @@ Sample music configuration:
247
247
248
248
For details on how this section is processed further you can check out ` nin/dasBoot/BEATBEAN.js ` .
249
249
250
+ ### Text
251
+
252
+ How to write text, or letters in general, to your 2D canvas.
253
+
254
+ Out of the box you can write text to your canvas like this:
255
+
256
+ ``` js
257
+ this .canvas .getContext (' 2d' ).fillStyle = ' #ffffff' ; // The color of the text you are going to be displaying
258
+ this .canvas .getContext (' 2d' ).font = ' bold ' + (24 ) + ' pt Arial' ; // Pattern: weight [size]size_unit font_name
259
+ this .canvas .getContext (' 2d' ).textAlign = ' center' ;
260
+ this .canvas .getContext (' 2d' ).textBaseline = ' middle' ;
261
+ this .canvas .getContext (' 2d' ).fillText (' Hello Nin!' , x_position_on_canvas, y_position_on_canvas);
262
+ ```
263
+
250
264
## Linting
251
265
252
266
The frontend part of this project uses ESLint for linting.
You can’t perform that action at this time.
0 commit comments