Skip to content

Commit c9c49b3

Browse files
committed
update docs
1 parent 118783b commit c9c49b3

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

public/about.html

+16-5
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ <h2><a id="settings">Game Configuration</a></h2>
361361
// useful to create your own mouse/touch handler
362362
settings.tapEvents = true
363363

364-
// set to `false` to disable the `iskeydown()` method
364+
// set to `false` to disable the built in keyboard functions
365365
// useful to create your own keyboard handler
366366
settings.keyboardEvents = true</code></pre>
367367

@@ -454,7 +454,7 @@ <h2><a id="drawing">Functions for Drawing</a></h2>
454454
// Sets the font family for texts
455455
textfont(fontName: string): void
456456

457-
// Sets the font size (default: 32)
457+
// Sets the font size (default: 18)
458458
textsize(size: number): void
459459

460460
/**
@@ -534,9 +534,15 @@ <h2><a id="sound">Functions for Sound</a></h2>
534534

535535
<h2><a id="keyboard">Functions for Keyboard</a></h2>
536536

537-
<pre><code class="language-typescript">// Checks if which key is currently pressed in your keyboard.
538-
// note: you can check if any key is pressed using `iskeydown("any")`.
539-
iskeydown(key: string): boolean</code></pre>
537+
<pre><code class="language-typescript">// Checks if any or which key is currently pressed in your keyboard.
538+
// example: iskeydown('space') // returns true if space bar is down
539+
// example: iskeydown() // returns true for any key
540+
iskeydown(key: string): boolean
541+
542+
// Checks if any or which key just got pressed in your keyboard.
543+
// example: iskeypressed('space') // returns true if space bar is pressed
544+
// example: iskeypressed() // returns true for any key
545+
iskeypressed(key: string): boolean</code></pre>
540546

541547
<h2><a id="math">Functions for Math</a></h2>
542548

@@ -553,6 +559,11 @@ <h2><a id="math">Functions for Math</a></h2>
553559
// Convert radians to degrees
554560
rad2deg(n: number): number
555561

562+
// Returns the rounded value of an number to optional precision.
563+
// example: round(PI) return 3
564+
// example: round(PI, 3) return 3.142
565+
round(value: number, precision = 0): number
566+
556567
// Constrains a number between `min` and `max`.
557568
// example: clamp(50, 0, 100) return 50
558569
// example: clamp(150, 0, 100) return 100

public/litecanvas.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@
131131
return 180 / PI * rads;
132132
},
133133
/**
134-
* Calculates the integer closest to a number and optional precision.
134+
* Returns the rounded value of an number to optional precision (number of digits after the decimal point).
135+
*
136+
* Note: precision is optional but must be >= 0
135137
*
136138
* @param {number} n number to round.
137139
* @param {number} [precision] number of decimal digits to round to, default is 0.

public/sw.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const cacheName = "luizbills.litecanvas-editor-v1";
2-
const version = "2.77.0";
2+
const version = "2.77.1";
33

44
const precacheResources = [
55
"/",

0 commit comments

Comments
 (0)