textmode.js 0.2.0-beta.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,11 +11,11 @@ export interface RenderingCapabilities {
11
11
  /**
12
12
  * Set a custom shader for subsequent rendering operations.
13
13
  * Pass null to return to the default shader.
14
- * @param shader The custom shader to use, or null to use the default shader
14
+ * @param shader The custom shader to use
15
15
  *
16
16
  * @example
17
17
  * ```javascript
18
- * const t = await textmode.create({
18
+ * const t = textmode.create({
19
19
  * width: 800,
20
20
  * height: 600,
21
21
  * })
@@ -38,7 +38,7 @@ export interface RenderingCapabilities {
38
38
  * });
39
39
  * ```
40
40
  */
41
- shader(shader: GLShader | null): void;
41
+ shader(shader: GLShader): void;
42
42
  /**
43
43
  * Set a uniform value for the current custom shader.
44
44
  * @param name The name of the uniform variable
@@ -46,7 +46,7 @@ export interface RenderingCapabilities {
46
46
  *
47
47
  * @example
48
48
  * ```javascript
49
- * const t = await textmode.create({
49
+ * const t = textmode.create({
50
50
  * width: 800,
51
51
  * height: 600,
52
52
  * })
@@ -70,7 +70,7 @@ export interface RenderingCapabilities {
70
70
  *
71
71
  * @example
72
72
  * ```javascript
73
- * const t = await textmode.create({
73
+ * const t = textmode.create({
74
74
  * width: 800,
75
75
  * height: 600,
76
76
  * })
@@ -97,11 +97,11 @@ export interface RenderingCapabilities {
97
97
  * The fragment shader will automatically receive the standard vertex shader inputs
98
98
  * and must output to all 5 MRT attachments.
99
99
  * @param fragmentSource The fragment shader source code
100
- * @returns A compiled shader ready for use with shader()
100
+ * @returns A compiled shader ready for use with {@link shader}
101
101
  *
102
102
  * @example
103
103
  * ```javascript
104
- * const t = await textmode.create({
104
+ * const t = textmode.create({
105
105
  * width: 800,
106
106
  * height: 600,
107
107
  * })
@@ -157,7 +157,7 @@ export interface RenderingCapabilities {
157
157
  *
158
158
  * @example
159
159
  * ```javascript
160
- * const t = await textmode.create({
160
+ * const t = textmode.create({
161
161
  * width: 800,
162
162
  * height: 600,
163
163
  * })
@@ -182,7 +182,7 @@ export interface RenderingCapabilities {
182
182
  *
183
183
  * @example
184
184
  * ```javascript
185
- * const t = await textmode.create({
185
+ * const t = textmode.create({
186
186
  * width: 800,
187
187
  * height: 600,
188
188
  * })
@@ -201,7 +201,7 @@ export interface RenderingCapabilities {
201
201
  *
202
202
  * @example
203
203
  * ```javascript
204
- * const t = await textmode.create({
204
+ * const t = textmode.create({
205
205
  * width: 800,
206
206
  * height: 600,
207
207
  * })
@@ -220,7 +220,7 @@ export interface RenderingCapabilities {
220
220
  *
221
221
  * @example
222
222
  * ```javascript
223
- * const t = await textmode.create({
223
+ * const t = textmode.create({
224
224
  * width: 800,
225
225
  * height: 600,
226
226
  * })
@@ -239,7 +239,7 @@ export interface RenderingCapabilities {
239
239
  *
240
240
  * @example
241
241
  * ```javascript
242
- * const t = await textmode.create({
242
+ * const t = textmode.create({
243
243
  * width: 800,
244
244
  * height: 600,
245
245
  * })
@@ -248,7 +248,8 @@ export interface RenderingCapabilities {
248
248
  * t.background(0);
249
249
  *
250
250
  * t.push(); // Save current state
251
- * // todo...
251
+ * t.charColor(255, 0, 0); // Red characters
252
+ * t.rect(10, 10, 5, 5);
252
253
  * t.pop(); // Restore previous state
253
254
  * });
254
255
  * ```
@@ -260,7 +261,7 @@ export interface RenderingCapabilities {
260
261
  *
261
262
  * @example
262
263
  * ```javascript
263
- * const t = await textmode.create({
264
+ * const t = textmode.create({
264
265
  * width: 800,
265
266
  * height: 600,
266
267
  * })
@@ -269,7 +270,9 @@ export interface RenderingCapabilities {
269
270
  * t.background(0);
270
271
  *
271
272
  * t.push(); // Save current state
272
- * // todo...
273
+ * t.charColor(0, 255, 0); // Green characters
274
+ * t.char('█');
275
+ * t.rect(5, 5, 3, 3);
273
276
  * t.pop(); // Restore previous state
274
277
  * });
275
278
  * ```
@@ -277,14 +280,14 @@ export interface RenderingCapabilities {
277
280
  pop(): void;
278
281
  /**
279
282
  * Draw a rectangle with the current settings.
280
- * @param x X-coordinate of the rectangle
281
- * @param y Y-coordinate of the rectangle
283
+ * @param x X-coordinate of the rectangle *(top-left corner)*
284
+ * @param y Y-coordinate of the rectangle *(top-left corner)*
282
285
  * @param width Width of the rectangle
283
286
  * @param height Height of the rectangle
284
287
  *
285
288
  * @example
286
289
  * ```javascript
287
- * const t = await textmode.create({
290
+ * const t = textmode.create({
288
291
  * width: 800,
289
292
  * height: 600,
290
293
  * })
@@ -293,7 +296,10 @@ export interface RenderingCapabilities {
293
296
  * // Set the background color to black
294
297
  * t.background(0);
295
298
  *
296
- * // todo...
299
+ * // Draw a filled rectangle with default character
300
+ * t.char('█');
301
+ * t.charColor(255, 255, 255); // White
302
+ * t.rect(10, 10, 15, 8);
297
303
  * });
298
304
  * ```
299
305
  */
@@ -307,7 +313,7 @@ export interface RenderingCapabilities {
307
313
  *
308
314
  * @example
309
315
  * ```javascript
310
- * const t = await textmode.create({
316
+ * const t = textmode.create({
311
317
  * width: 800,
312
318
  * height: 600,
313
319
  * })
@@ -316,7 +322,11 @@ export interface RenderingCapabilities {
316
322
  * // Set the background color to black
317
323
  * t.background(0);
318
324
  *
319
- * // todo
325
+ * // Draw a diagonal line
326
+ * t.char('-');
327
+ * t.charColor(0, 255, 255); // Cyan
328
+ * t.lineWeight(1);
329
+ * t.line(5, 5, 25, 15);
320
330
  * });
321
331
  * ```
322
332
  */
@@ -330,7 +340,7 @@ export interface RenderingCapabilities {
330
340
  *
331
341
  * @example
332
342
  * ```javascript
333
- * const t = await textmode.create({
343
+ * const t = textmode.create({
334
344
  * width: 800,
335
345
  * height: 600,
336
346
  * })
@@ -347,7 +357,7 @@ export interface RenderingCapabilities {
347
357
  *
348
358
  * @example
349
359
  * ```javascript
350
- * const t = await textmode.create({
360
+ * const t = textmode.create({
351
361
  * width: 800,
352
362
  * height: 600,
353
363
  * })
@@ -365,7 +375,7 @@ export interface RenderingCapabilities {
365
375
  *
366
376
  * @example
367
377
  * ```javascript
368
- * const t = await textmode.create({
378
+ * const t = textmode.create({
369
379
  * width: 800,
370
380
  * height: 600,
371
381
  * })
@@ -392,7 +402,7 @@ export interface RenderingCapabilities {
392
402
  *
393
403
  * @example
394
404
  * ```javascript
395
- * const t = await textmode.create({
405
+ * const t = textmode.create({
396
406
  * width: 800,
397
407
  * height: 600,
398
408
  * })
@@ -400,7 +410,11 @@ export interface RenderingCapabilities {
400
410
  * t.draw(() => {
401
411
  * t.background(0);
402
412
  *
403
- * // todo
413
+ * // Draw a smooth S-curve
414
+ * t.char('*');
415
+ * t.charColor(255, 100, 255); // Magenta
416
+ * t.lineWeight(2);
417
+ * t.bezierCurve(5, 20, 15, 5, 25, 35, 35, 20);
404
418
  * });
405
419
  * ```
406
420
  */
@@ -411,7 +425,7 @@ export interface RenderingCapabilities {
411
425
  *
412
426
  * @example
413
427
  * ```javascript
414
- * const t = await textmode.create({
428
+ * const t = textmode.create({
415
429
  * width: 800,
416
430
  * height: 600,
417
431
  * })
@@ -429,11 +443,10 @@ export interface RenderingCapabilities {
429
443
  * @param r Red component (0-255)
430
444
  * @param g Green component (0-255)
431
445
  * @param b Blue component (0-255)
432
- * @param a Alpha component (0-255)
433
446
  *
434
447
  * @example
435
448
  * ```javascript
436
- * const t = await textmode.create({
449
+ * const t = textmode.create({
437
450
  * width: 800,
438
451
  * height: 600,
439
452
  * })
@@ -451,11 +464,10 @@ export interface RenderingCapabilities {
451
464
  * @param r Red component (0-255)
452
465
  * @param g Green component (0-255)
453
466
  * @param b Blue component (0-255)
454
- * @param a Alpha component (0-255)
455
467
  *
456
468
  * @example
457
469
  * ```javascript
458
- * const t = await textmode.create({
470
+ * const t = textmode.create({
459
471
  * width: 800,
460
472
  * height: 600,
461
473
  * })
@@ -474,7 +486,7 @@ export interface RenderingCapabilities {
474
486
  *
475
487
  * @example
476
488
  * ```javascript
477
- * const t = await textmode.create({
489
+ * const t = textmode.create({
478
490
  * width: 800,
479
491
  * height: 600,
480
492
  * })
@@ -493,7 +505,7 @@ export interface RenderingCapabilities {
493
505
  *
494
506
  * @example
495
507
  * ```javascript
496
- * const t = await textmode.create({
508
+ * const t = textmode.create({
497
509
  * width: 800,
498
510
  * height: 600,
499
511
  * })
@@ -512,14 +524,14 @@ export interface RenderingCapabilities {
512
524
  *
513
525
  * @example
514
526
  * ```javascript
515
- * const t = await textmode.create({
527
+ * const t = textmode.create({
516
528
  * width: 800,
517
529
  * height: 600,
518
530
  * })
519
531
  *
520
532
  * t.draw(() => {
521
533
  * t.background(0);
522
- * t.charRotation(45); // Rotate character 45 degrees
534
+ * t.charRotation(90); // Rotate character 90 degrees
523
535
  * t.rect(10, 10, 5, 5);
524
536
  * });
525
537
  * ```
@@ -531,7 +543,7 @@ export interface RenderingCapabilities {
531
543
  *
532
544
  * @example
533
545
  * ```javascript
534
- * const t = await textmode.create({
546
+ * const t = textmode.create({
535
547
  * width: 800,
536
548
  * height: 600,
537
549
  * })
@@ -553,7 +565,7 @@ export interface RenderingCapabilities {
553
565
  *
554
566
  * @example
555
567
  * ```javascript
556
- * const t = await textmode.create({
568
+ * const t = textmode.create({
557
569
  * width: 800,
558
570
  * height: 600,
559
571
  * })
@@ -576,7 +588,7 @@ export interface RenderingCapabilities {
576
588
  *
577
589
  * @example
578
590
  * ```javascript
579
- * const t = await textmode.create({
591
+ * const t = textmode.create({
580
592
  * width: 800,
581
593
  * height: 600,
582
594
  * })
@@ -599,7 +611,7 @@ export interface RenderingCapabilities {
599
611
  *
600
612
  * @example
601
613
  * ```javascript
602
- * const t = await textmode.create({
614
+ * const t = textmode.create({
603
615
  * width: 800,
604
616
  * height: 600,
605
617
  * })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "textmode.js",
3
- "version": "0.2.0-beta.4",
4
- "description": "Apply real-time ASCII conversion to any HTML canvas.",
3
+ "version": "0.2.0",
4
+ "description": "textmode.js is a lightweight creative coding library for creating real-time ASCII art on the web.",
5
5
  "type": "module",
6
6
  "types": "./dist/types/index.d.ts",
7
7
  "main": "./dist/textmode.umd.js",
@@ -55,14 +55,18 @@
55
55
  "petscii",
56
56
  "textmode",
57
57
  "canvas",
58
- "webgl"
58
+ "webgl",
59
+ "creative-coding",
60
+ "art",
61
+ "design",
62
+ "graphics"
59
63
  ],
60
64
  "author": "humanbydefinition",
61
65
  "license": "MIT",
62
66
  "bugs": {
63
67
  "url": "https://github.com/humanbydefinition/textmode.js/issues"
64
68
  },
65
- "homepage": "https://github.com/humanbydefinition/textmode.js",
69
+ "homepage": "https://code.textmode.art",
66
70
  "files": [
67
71
  "dist"
68
72
  ]