Skip to content

Commit

Permalink
update engine
Browse files Browse the repository at this point in the history
  • Loading branch information
luizbills committed May 11, 2024
1 parent 2433f23 commit 19b6e0f
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 100 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions public/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ <h1>LITECANVAS</h1>
<strong>API</strong>: <a href="#colors">Colors</a> |
<a href="#settings">Configuration</a> | <a href="#drawing">Drawing</a> |
<a href="#sound">Sound</a> | <a href="#math">Math</a> |
<a href="#globals">Globals</a> |
<a href="#plugin-api">Plugin API</a> |
<a href="#globals">Globals</a> | <a href="#plugin-api">Plugin API</a> |
<a href="#advanced">Advanced</a>
</nav>

Expand Down Expand Up @@ -192,8 +191,8 @@ <h2><a id="drawing">Functions for Drawing</a></h2>

// clear the canvas
// all color argument is a integer (a color from 0 to 7)
// alias: cls(...)
clear(color: null|number): void
// alias: clear
cls(color: null|number): void

// draw a color-filled rectangle
rectfill(x, y, w, h, color = 0): void
Expand Down Expand Up @@ -229,7 +228,7 @@ <h2><a id="drawing">Functions for Drawing</a></h2>
*/

// draw a text
// alias: print(...)
// alias: print
text(x, y, text, color = 3): void

// set the text alignment and baseline
Expand Down Expand Up @@ -364,12 +363,17 @@ <h2><a id="math">Math</a></h2>
// Convert radians to degrees
rad2deg(n: number): number

// Force a value within the boundaries by clamping it to the range min, max.
// Constrains a number between `min` and `max`.
// example: clamp(50, 0, 100) return 50
// example: clamp(150, 0, 100) return 100
// example: clamp(-10, 0, 100) return 0
clamp(value: number, min: number, max: number): number

// Wraps a number between `min` and `max`.
// example: wrap(50,0,100) return 50
// example: wrap(125, 0, 100) return 25
wrap(value: number, min: number, max: number): number

// Re-maps a number from one range to another.
// example: map(2, 0, 10, 0, 100) returns 20
map(val, l1, h1, l2, h2, withinBounds = false ): number
Expand Down
2 changes: 1 addition & 1 deletion public/app.js

Large diffs are not rendered by default.

Loading

0 comments on commit 19b6e0f

Please sign in to comment.