|
10 | 10 | <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
11 | 11 | <link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap" rel="stylesheet"> |
12 | 12 | <link rel="stylesheet" href="prism/prism.css" /> |
13 | | - <link rel="icon" href="icons/favicon.ico" /> |
| 13 | + <link rel="icon" type="image/png" href="icons/icon-64.png" /> |
14 | 14 | <script defer src="https://umami.luizbills.com/script.js" data-website-id="3143e924-b3a6-42ce-b374-3f527dc894e2"></script> |
15 | 15 | <style> |
16 | 16 | html { |
@@ -319,7 +319,7 @@ <h2><a id="colors">Default Colors</a></h2> |
319 | 319 | Every time a function asks for a color, choose must choose one of these numbers. |
320 | 320 | </p> |
321 | 321 |
|
322 | | - <img src="images/colors.png" alt="Default Color Palette" /> |
| 322 | + <img src="images/colors.png" alt="Default Color Palette" style="border: 2px solid white;"/> |
323 | 323 |
|
324 | 324 | <p>Download: <a href="/misc/litecanvas-palette.gpl">palette.gpl</a> or <a href="/misc/litecanvas-palette.json" download>palette.json</a></p> |
325 | 325 |
|
@@ -429,6 +429,10 @@ <h2><a id="drawing">Functions for Drawing</a></h2> |
429 | 429 | // draw a outline ellipse |
430 | 430 | oval(x, y, rx, ry, color = 0): void |
431 | 431 |
|
| 432 | +// make a shape in the canvas context. To draw the shape you must call `fill()` or `stroke()` right after. |
| 433 | +// example: shape([4,0,8,8,0,8]); fill(3); // draw a triangle |
| 434 | +shape(points: number[]): void |
| 435 | + |
432 | 436 | // draw a line from one point (x1, y1) to another (x2, y2) |
433 | 437 | line(x1, y1, x2, y2, color = 0): void |
434 | 438 |
|
@@ -469,9 +473,9 @@ <h2><a id="drawing">Functions for Drawing</a></h2> |
469 | 473 | // draw a image |
470 | 474 | image(x, y, image: Image|ImageBitmap): void |
471 | 475 |
|
472 | | -// draw a sprite pixel by pixel from a string (the 5th argument) |
| 476 | +// draw a sprite pixel by pixel from a string (the 3rd argument) |
473 | 477 | // see: https://github.com/litecanvas/game-engine/blob/main/samples/pixelart/pixelart.js#L50 |
474 | | -spr(x, y, width, heigth, pixels): void |
| 478 | +spr(x, y, pixels): void |
475 | 479 |
|
476 | 480 | // create an OffscreenCanvas and draw on it to make an image |
477 | 481 | // see: https://github.com/litecanvas/game-engine/blob/main/samples/paint/paint.js |
@@ -687,7 +691,7 @@ <h2><a id="engine-api">Engine API</a></h2> |
687 | 691 | // Update or reset the palette color |
688 | 692 | // example: pal(['#000', '#FFF']) is a 1-bit color palette |
689 | 693 | // example: pal() resets the default color palette |
690 | | -pal(colors: string[]): void |
| 694 | +pal(colors: string[], textColor: number = 3): void |
691 | 695 |
|
692 | 696 | // Replace the color "a" with the color "b" |
693 | 697 | // example: pal(0, 3) // now the color black (#0) is white (#3) |
|
0 commit comments