litecanvas 0.209.0 → 0.301.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/README.md +1 -2
- package/dist/dist.dev.js +174 -160
- package/dist/dist.js +18 -14
- package/dist/dist.min.js +1 -1
- package/package.json +4 -4
- package/src/index.js +190 -172
- package/src/version.js +1 -1
- package/types/global.d.ts +11 -11
- package/types/types.d.ts +11 -11
package/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '0.
|
|
2
|
+
export const version = '0.301.0'
|
package/types/global.d.ts
CHANGED
|
@@ -25,16 +25,8 @@ declare global {
|
|
|
25
25
|
/**
|
|
26
26
|
* Twice the value of the mathematical constant PI (π).
|
|
27
27
|
* Approximately 6.28318
|
|
28
|
-
*
|
|
29
|
-
* Note: TWO_PI radians equals 360°, PI radians equals 180°,
|
|
30
|
-
* HALF_PI radians equals 90°, and HALF_PI/2 radians equals 45°.
|
|
31
|
-
*/
|
|
32
|
-
var TWO_PI: number
|
|
33
|
-
/**
|
|
34
|
-
* Half the value of the mathematical constant PI (π).
|
|
35
|
-
* Approximately 1.57079
|
|
36
28
|
*/
|
|
37
|
-
var
|
|
29
|
+
var TAU: number
|
|
38
30
|
/**
|
|
39
31
|
* Calculates a linear (interpolation) value over t%.
|
|
40
32
|
*
|
|
@@ -68,8 +60,8 @@ declare global {
|
|
|
68
60
|
* @param b divisor
|
|
69
61
|
* @returns the remainder
|
|
70
62
|
* @example
|
|
71
|
-
*
|
|
72
|
-
*
|
|
63
|
+
* mod(-1, 5) // => 4
|
|
64
|
+
* -1 % 5 // => -1
|
|
73
65
|
*/
|
|
74
66
|
function mod(a: number, b: number): number
|
|
75
67
|
/**
|
|
@@ -695,6 +687,14 @@ declare global {
|
|
|
695
687
|
* Returns `true` if the engine loop is paused.
|
|
696
688
|
*/
|
|
697
689
|
function ispaused(): boolean
|
|
690
|
+
/**
|
|
691
|
+
* Resizes the canvas
|
|
692
|
+
*
|
|
693
|
+
* @param width
|
|
694
|
+
* @param height
|
|
695
|
+
* @param autoscale
|
|
696
|
+
*/
|
|
697
|
+
function resize(width: number, height?: number, autoscale?: boolean | number): void
|
|
698
698
|
/**
|
|
699
699
|
* Shutdown the litecanvas instance and remove all event listeners.
|
|
700
700
|
*/
|
package/types/types.d.ts
CHANGED
|
@@ -19,16 +19,8 @@ type LitecanvasInstance = {
|
|
|
19
19
|
/**
|
|
20
20
|
* Twice the value of the mathematical constant PI (π).
|
|
21
21
|
* Approximately 6.28318
|
|
22
|
-
*
|
|
23
|
-
* Note: TWO_PI radians equals 360°, PI radians equals 180°,
|
|
24
|
-
* HALF_PI radians equals 90°, and HALF_PI/2 radians equals 45°.
|
|
25
|
-
*/
|
|
26
|
-
TWO_PI: number
|
|
27
|
-
/**
|
|
28
|
-
* Half the value of the mathematical constant PI (π).
|
|
29
|
-
* Approximately 1.57079
|
|
30
22
|
*/
|
|
31
|
-
|
|
23
|
+
TAU: number
|
|
32
24
|
/**
|
|
33
25
|
* Calculates a linear (interpolation) value over t%.
|
|
34
26
|
*
|
|
@@ -62,8 +54,8 @@ type LitecanvasInstance = {
|
|
|
62
54
|
* @param b divisor
|
|
63
55
|
* @returns the remainder
|
|
64
56
|
* @example
|
|
65
|
-
*
|
|
66
|
-
*
|
|
57
|
+
* mod(-1, 5) // => 4
|
|
58
|
+
* -1 % 5 // => -1
|
|
67
59
|
*/
|
|
68
60
|
mod(a: number, b: number): number
|
|
69
61
|
/**
|
|
@@ -679,6 +671,14 @@ type LitecanvasInstance = {
|
|
|
679
671
|
* Returns `true` if the engine loop is paused.
|
|
680
672
|
*/
|
|
681
673
|
ispaused(): boolean
|
|
674
|
+
/**
|
|
675
|
+
* Resizes the canvas
|
|
676
|
+
*
|
|
677
|
+
* @param width
|
|
678
|
+
* @param height
|
|
679
|
+
* @param autoscale
|
|
680
|
+
*/
|
|
681
|
+
resize(width: number, height?: number, autoscale?: boolean | number): void
|
|
682
682
|
/**
|
|
683
683
|
* Shutdown the litecanvas instance and remove all event listeners.
|
|
684
684
|
*/
|