q5 4.3.0 → 4.4.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.
- package/deno.json +1 -1
- package/package.json +1 -1
- package/q5.d.ts +50 -16
- package/q5.js +437 -109
- package/q5.min.js +2 -2
package/deno.json
CHANGED
package/package.json
CHANGED
package/q5.d.ts
CHANGED
|
@@ -133,6 +133,8 @@ declare global {
|
|
|
133
133
|
|
|
134
134
|
/** 🧑🎨
|
|
135
135
|
* Draws a line on the canvas.
|
|
136
|
+
*
|
|
137
|
+
* To draw lines with rounded stroke caps, use `capsule` instead.
|
|
136
138
|
* @param {number} x1 x-coordinate of the first point
|
|
137
139
|
* @param {number} y1 y-coordinate of the first point
|
|
138
140
|
* @param {number} x2 x-coordinate of the second point
|
|
@@ -3820,33 +3822,51 @@ declare global {
|
|
|
3820
3822
|
function curveDetail(val: number): void;
|
|
3821
3823
|
|
|
3822
3824
|
/** 🖌
|
|
3823
|
-
* Starts storing vertices for a
|
|
3825
|
+
* Starts storing vertices for a shape.
|
|
3824
3826
|
*/
|
|
3825
3827
|
function beginShape(): void;
|
|
3826
3828
|
|
|
3827
3829
|
/** 🖌
|
|
3828
|
-
* Ends storing vertices for a
|
|
3830
|
+
* Ends storing vertices for a shape.
|
|
3831
|
+
* @param {boolean} [close] whether to close the shape by connecting the last vertex to the first vertex, default is false
|
|
3829
3832
|
*/
|
|
3830
3833
|
function endShape(): void;
|
|
3831
3834
|
|
|
3832
|
-
/** 🖌
|
|
3833
|
-
* Starts storing vertices for a contour.
|
|
3834
|
-
*
|
|
3835
|
-
* Not available in q5 WebGPU.
|
|
3836
|
-
*/
|
|
3837
|
-
function beginContour(): void;
|
|
3838
|
-
|
|
3839
|
-
/** 🖌
|
|
3840
|
-
* Ends storing vertices for a contour.
|
|
3841
|
-
*
|
|
3842
|
-
* Not available in q5 WebGPU.
|
|
3843
|
-
*/
|
|
3844
|
-
function endContour(): void;
|
|
3845
|
-
|
|
3846
3835
|
/** 🖌
|
|
3847
3836
|
* Specifies a vertex in a shape.
|
|
3837
|
+
*
|
|
3838
|
+
* Each vertex can have its own fill color. Useful for creating gradients.
|
|
3839
|
+
*
|
|
3840
|
+
* Note that shapes without a stroke will be drawn using the shapes shader. Stroked shapes will be drawn using the more complex stroked shapes shader.
|
|
3848
3841
|
* @param {number} x x-coordinate
|
|
3849
3842
|
* @param {number} y y-coordinate
|
|
3843
|
+
* @example
|
|
3844
|
+
* await Canvas(200);
|
|
3845
|
+
*
|
|
3846
|
+
* noStroke();
|
|
3847
|
+
*
|
|
3848
|
+
* beginShape();
|
|
3849
|
+
* fill(1, 0, 0);
|
|
3850
|
+
* vertex(-80, -80);
|
|
3851
|
+
* vertex(40, -60);
|
|
3852
|
+
* fill(0, 0, 1);
|
|
3853
|
+
* vertex(80, 60);
|
|
3854
|
+
* vertex(-60, 80);
|
|
3855
|
+
* endShape(true);
|
|
3856
|
+
* @example
|
|
3857
|
+
* await Canvas(200);
|
|
3858
|
+
*
|
|
3859
|
+
* stroke(1, 0.5);
|
|
3860
|
+
* strokeWeight(20);
|
|
3861
|
+
*
|
|
3862
|
+
* beginShape();
|
|
3863
|
+
* fill(1, 0, 0);
|
|
3864
|
+
* vertex(-80, -80);
|
|
3865
|
+
* vertex(40, -60);
|
|
3866
|
+
* fill(0, 0, 1);
|
|
3867
|
+
* vertex(80, 60);
|
|
3868
|
+
* vertex(-60, 80);
|
|
3869
|
+
* endShape(true);
|
|
3850
3870
|
*/
|
|
3851
3871
|
function vertex(x: number, y: number): void;
|
|
3852
3872
|
|
|
@@ -3907,6 +3927,20 @@ declare global {
|
|
|
3907
3927
|
*/
|
|
3908
3928
|
function quad(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): void;
|
|
3909
3929
|
|
|
3930
|
+
/** 🖌
|
|
3931
|
+
* Starts storing vertices for a contour.
|
|
3932
|
+
*
|
|
3933
|
+
* Not available in q5 WebGPU.
|
|
3934
|
+
*/
|
|
3935
|
+
function beginContour(): void;
|
|
3936
|
+
|
|
3937
|
+
/** 🖌
|
|
3938
|
+
* Ends storing vertices for a contour.
|
|
3939
|
+
*
|
|
3940
|
+
* Not available in q5 WebGPU.
|
|
3941
|
+
*/
|
|
3942
|
+
function endContour(): void;
|
|
3943
|
+
|
|
3910
3944
|
// ⚡ shaders
|
|
3911
3945
|
|
|
3912
3946
|
/**
|