litecanvas 0.79.3 → 0.79.4
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/package.json +2 -2
- package/types/index.d.ts +6 -38
- package/types/types.d.ts +8 -40
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "litecanvas",
|
|
3
|
-
"version": "0.79.
|
|
4
|
-
"description": "Lightweight HTML5 canvas game engine suitable for small projects and creative coding. Inspired by PICO-8 and P5/Processing.",
|
|
3
|
+
"version": "0.79.4",
|
|
4
|
+
"description": "Lightweight HTML5 canvas 2D game engine suitable for small projects and creative coding. Inspired by PICO-8 and P5/Processing.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Luiz Bills <luizbills@pm.me>",
|
|
7
7
|
"contributors": [],
|
package/types/index.d.ts
CHANGED
|
@@ -496,52 +496,20 @@ declare global {
|
|
|
496
496
|
/** UTILS API */
|
|
497
497
|
/**
|
|
498
498
|
* Checks if a which key is pressed on the keyboard.
|
|
499
|
-
* Note: use `iskeydown(
|
|
499
|
+
* Note: use `iskeydown()` to check for any key pressed.
|
|
500
500
|
*
|
|
501
501
|
* @param key
|
|
502
502
|
* @returns `true` if the which key is down
|
|
503
503
|
*/
|
|
504
504
|
function iskeydown(key: string): boolean
|
|
505
505
|
/**
|
|
506
|
-
*
|
|
506
|
+
* Checks if a which key just got pressed on the keyboard.
|
|
507
|
+
* Note: use `iskeypressed()` to check for any key.
|
|
507
508
|
*
|
|
508
|
-
* @param
|
|
509
|
-
* @
|
|
510
|
-
* @param w1 first rectangle width
|
|
511
|
-
* @param h1 first rectangle height
|
|
512
|
-
* @param x2 second rectangle position X
|
|
513
|
-
* @param y2 second rectangle position Y
|
|
514
|
-
* @param w2 second rectangle width
|
|
515
|
-
* @param h2 second rectangle height
|
|
509
|
+
* @param [key]
|
|
510
|
+
* @returns `true` if the which key was pressed
|
|
516
511
|
*/
|
|
517
|
-
function
|
|
518
|
-
x1: number,
|
|
519
|
-
y1: number,
|
|
520
|
-
w1: number,
|
|
521
|
-
h1: number,
|
|
522
|
-
x2: number,
|
|
523
|
-
y2: number,
|
|
524
|
-
w2: number,
|
|
525
|
-
h2: number
|
|
526
|
-
): boolean
|
|
527
|
-
/**
|
|
528
|
-
* Check a collision between two circles
|
|
529
|
-
*
|
|
530
|
-
* @param x1 first circle position X
|
|
531
|
-
* @param y1 first circle position Y
|
|
532
|
-
* @param r1 first circle position radius
|
|
533
|
-
* @param x2 second circle position X
|
|
534
|
-
* @param y2 second circle position Y
|
|
535
|
-
* @param r2 second circle position radius
|
|
536
|
-
*/
|
|
537
|
-
function colcirc(
|
|
538
|
-
x1: number,
|
|
539
|
-
y1: number,
|
|
540
|
-
r1: number,
|
|
541
|
-
x2: number,
|
|
542
|
-
y2: number,
|
|
543
|
-
r2: number
|
|
544
|
-
): boolean
|
|
512
|
+
function iskeypressed(key: string): boolean
|
|
545
513
|
|
|
546
514
|
/** PLUGINS API */
|
|
547
515
|
/**
|
package/types/types.d.ts
CHANGED
|
@@ -474,52 +474,20 @@ type LitecanvasInstance = {
|
|
|
474
474
|
/** UTILS API */
|
|
475
475
|
/**
|
|
476
476
|
* Checks if a which key is pressed on the keyboard.
|
|
477
|
-
* Note: use `iskeydown(
|
|
477
|
+
* Note: use `iskeydown()` to check for any key pressed.
|
|
478
478
|
*
|
|
479
479
|
* @param key
|
|
480
480
|
* @returns `true` if the which key is down
|
|
481
481
|
*/
|
|
482
482
|
iskeydown(key: string): boolean
|
|
483
483
|
/**
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
* @param
|
|
488
|
-
* @
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
* @param y2 second rectangle position Y
|
|
492
|
-
* @param w2 second rectangle width
|
|
493
|
-
* @param h2 second rectangle height
|
|
494
|
-
*/
|
|
495
|
-
colrect(
|
|
496
|
-
x1: number,
|
|
497
|
-
y1: number,
|
|
498
|
-
w1: number,
|
|
499
|
-
h1: number,
|
|
500
|
-
x2: number,
|
|
501
|
-
y2: number,
|
|
502
|
-
w2: number,
|
|
503
|
-
h2: number
|
|
504
|
-
): boolean
|
|
505
|
-
/**
|
|
506
|
-
* Check a collision between two circles
|
|
507
|
-
*
|
|
508
|
-
* @param x1 first circle position X
|
|
509
|
-
* @param y1 first circle position Y
|
|
510
|
-
* @param r1 first circle position radius
|
|
511
|
-
* @param x2 second circle position X
|
|
512
|
-
* @param y2 second circle position Y
|
|
513
|
-
* @param r2 second circle position radius
|
|
514
|
-
*/
|
|
515
|
-
colcirc(
|
|
516
|
-
x1: number,
|
|
517
|
-
y1: number,
|
|
518
|
-
r1: number,
|
|
519
|
-
x2: number,
|
|
520
|
-
y2: number,
|
|
521
|
-
r2: number
|
|
522
|
-
): boolean
|
|
484
|
+
* Checks if a which key just got pressed on the keyboard.
|
|
485
|
+
* Note: use `iskeypressed()` to check for any key.
|
|
486
|
+
*
|
|
487
|
+
* @param [key]
|
|
488
|
+
* @returns `true` if the which key was pressed
|
|
489
|
+
*/
|
|
490
|
+
iskeypressed(key: string): boolean
|
|
523
491
|
|
|
524
492
|
/** PLUGINS API */
|
|
525
493
|
/**
|