diff --git a/package-lock.json b/package-lock.json index 4753e82..b273fec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -523,9 +523,9 @@ } }, "node_modules/@litecanvas/litecanvas": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/@litecanvas/litecanvas/-/litecanvas-0.30.0.tgz", - "integrity": "sha512-MEzOMquCPiOR5hUTkjzgUvvYnzLAlYYtCjVEgMZCgTp0+c61o9Z2eCBVmzZoJzfseEXdeQHLuHMfWdBRAv+tWQ==" + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@litecanvas/litecanvas/-/litecanvas-0.31.0.tgz", + "integrity": "sha512-/XAUKN3E/365I2QufqnnnkEvHZ0MEUkscFON6qEf7YCHiR5FhC7WFiNxni3sp3I2EIFxgnBH+Wd63BY1oaZ7DQ==" }, "node_modules/@litecanvas/plugin-asset-loader": { "version": "0.4.2", diff --git a/public/about.html b/public/about.html index acc5fa7..82852e9 100644 --- a/public/about.html +++ b/public/about.html @@ -92,8 +92,7 @@

LITECANVAS

API: Colors | Configuration | Drawing | Sound | Math | - Globals | - Plugin API | + Globals | Plugin API | Advanced @@ -192,8 +191,8 @@

Functions for Drawing

// 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 @@ -229,7 +228,7 @@

Functions for Drawing

*/ // draw a text -// alias: print(...) +// alias: print text(x, y, text, color = 3): void // set the text alignment and baseline @@ -364,12 +363,17 @@

Math

// 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 diff --git a/public/app.js b/public/app.js index dd54ece..3767824 100644 --- a/public/app.js +++ b/public/app.js @@ -241,7 +241,7 @@ function draw () { <\/script>