q5 3.0.6 → 3.1.1

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.
Files changed (5) hide show
  1. package/deno.json +1 -1
  2. package/package.json +1 -1
  3. package/q5.d.ts +48 -2
  4. package/q5.js +693 -390
  5. package/q5.min.js +2 -2
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q5/q5",
3
- "version": "3.0.6",
3
+ "version": "3.1.1",
4
4
  "license": "LGPL-3.0",
5
5
  "description": "Beginner friendly graphics powered by WebGPU and optimized for interactive art!",
6
6
  "author": "quinton-ashley",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q5",
3
- "version": "3.0.6",
3
+ "version": "3.1.1",
4
4
  "description": "Beginner friendly graphics powered by WebGPU and optimized for interactive art!",
5
5
  "author": "quinton-ashley",
6
6
  "contributors": [
package/q5.d.ts CHANGED
@@ -349,6 +349,20 @@ q.circle(100, 50, 20);
349
349
  */
350
350
  static errorTolerant: boolean;
351
351
 
352
+ /** ⭐️
353
+ * The maximum number of rectangles that can be drawn in a single
354
+ * draw call.
355
+ * @default 200200
356
+ */
357
+ static MAX_RECTS: number;
358
+
359
+ /** ⭐️
360
+ * The maximum number of ellipses that can be drawn in a single
361
+ * draw call.
362
+ * @default 200200
363
+ */
364
+ static MAX_ELLIPSES: number;
365
+
352
366
  /** ⭐️
353
367
  * Modules added to this object will be added to new Q5 instances.
354
368
  */
@@ -558,7 +572,7 @@ background(200);
558
572
  stroke('red');
559
573
  circle(50, 100, 80);
560
574
 
561
- strokeWeight(20);
575
+ strokeWeight(12);
562
576
  circle(150, 100, 80);
563
577
  */
564
578
  function strokeWeight(weight: number): void;
@@ -599,7 +613,6 @@ background(200);
599
613
  noFill();
600
614
  shadow('black');
601
615
  rect(64, 60, 80, 80);
602
- text('q5', 100, 100);
603
616
  * @example
604
617
  createCanvas(200);
605
618
  let logo = loadImage('/assets/p5play_logo.webp');
@@ -614,6 +627,8 @@ function setup() {
614
627
 
615
628
  /** ⬜️
616
629
  * Disables the shadow effect.
630
+ *
631
+ * Not available in q5 WebGPU.
617
632
  * @example
618
633
  createCanvas(200);
619
634
  background(200);
@@ -630,6 +645,9 @@ rect(104, 104, 80, 80);
630
645
  * Sets the shadow offset and blur radius.
631
646
  *
632
647
  * When q5 starts, shadow offset is (10, 10) with a blur of 10.
648
+ *
649
+ * Not available in q5 WebGPU.
650
+ *
633
651
  * @param {number} offsetX horizontal offset of the shadow
634
652
  * @param {number} offsetY vertical offset of the shadow, defaults to be the same as offsetX
635
653
  * @param {number} blur blur radius of the shadow, defaults to 0
@@ -1368,6 +1386,29 @@ line(20, 20, 180, 80);
1368
1386
  */
1369
1387
  function line(x1: number, y1: number, x2: number, y2: number): void;
1370
1388
 
1389
+ /** 🧑‍🎨
1390
+ * Draws a capsule, which is pill shaped.
1391
+ * @param {number} x1 x-coordinate of the first point
1392
+ * @param {number} y1 y-coordinate of the first point
1393
+ * @param {number} x2 x-coordinate of the second point
1394
+ * @param {number} y2 y-coordinate of the second point
1395
+ * @param {number} r radius of the capsule semi-circle ends
1396
+ * @example
1397
+ createCanvas(200, 100);
1398
+ background(200);
1399
+ strokeWeight(5);
1400
+ capsule(40, 40, 160, 60, 10);
1401
+ * @example
1402
+ let q = await Q5.WebGPU();
1403
+
1404
+ q.draw = () => {
1405
+ background(0.8);
1406
+ strokeWeight(10);
1407
+ capsule(0, 0, mouseX, mouseY, 20);
1408
+ }
1409
+ */
1410
+ function capsule(x1: number, y1: number, x2: number, y2: number, r: number): void;
1411
+
1371
1412
  /** 🧑‍🎨
1372
1413
  * Draws a point on the canvas.
1373
1414
  * @param {number} x x-coordinate
@@ -4023,6 +4064,11 @@ function mousePressed() {
4023
4064
  /** ⚡️
4024
4065
  * Creates a shader that q5 can use to draw shapes.
4025
4066
  *
4067
+ * Affects the following functions:
4068
+ * `triangle`, `quad`, `plane`,
4069
+ * `curve`, `bezier`, `beginShape`/`endShape`,
4070
+ * and `background` (unless an image is used).
4071
+ *
4026
4072
  * Use this function to customize a copy of the
4027
4073
  * [default shapes shader](https://github.com/q5js/q5.js/blob/main/src/shaders/shapes.wgsl).
4028
4074
  *