Skip to content

Commit 7dbd554

Browse files
authored
adding more examples
1 parent 2c01692 commit 7dbd554

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/core/reference.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,36 @@
12041204
* }
12051205
* </code>
12061206
* </div>
1207+
*
1208+
* <div>
1209+
* <code>
1210+
* let font;
1211+
*
1212+
* async function setup() {
1213+
* // Load a font for WebGL mode.
1214+
* font = await loadFont('assets/inconsolata.otf');
1215+
*
1216+
* createCanvas(100, 100, WEBGL);
1217+
*
1218+
* describe(
1219+
* "A gray square. The mouse's x- and y-coordinates are displayed as the user moves the mouse."
1220+
* );
1221+
* }
1222+
*
1223+
* function draw() {
1224+
* background(200);
1225+
*
1226+
* // Style the text.
1227+
* textAlign(CENTER);
1228+
* textSize(16);
1229+
* textFont(font);
1230+
* fill(0);
1231+
*
1232+
* // Display the mouse's coordinates.
1233+
* text(`x: ${mouseX} y: ${mouseY}`, 0, 0);
1234+
* }
1235+
* </code>
1236+
* </div>
12071237
*/
12081238

12091239
/**

0 commit comments

Comments
 (0)