@@ -359,10 +359,6 @@ <h2><a id="settings">Game Configuration</a></h2>
359
359
// can pass a number to determine a maximum scale.
360
360
settings.autoscale = true
361
361
362
- // If `true`, the pixel art images won't look blurry.
363
- // Also, disables canvas built-in antialias.
364
- settings.pixelart = true
365
-
366
362
// exposes all methods and properties (see below)
367
363
// in the global scope
368
364
settings.global = true
@@ -466,12 +462,13 @@ <h2><a id="drawing">Functions for Drawing</a></h2>
466
462
*/
467
463
468
464
// draw a image
469
- image(x, y, image: Image|HTMLCanvasElement): void
465
+ image(x, y, image: Image|ImageBitmap): void
466
+
467
+ // draw a sprite pixel by pixel from a string (the 5th argument)
468
+ // see: https://github.com/litecanvas/game-engine/blob/main/samples/pixelart/pixelart.js#L50
469
+ spr(x, y, width, heigth, pixels): void
470
470
471
471
// create an OffscreenCanvas and draw on it to make an image
472
- // data can be a array of strings (to draw pixel art)
473
- // see: https://github.com/litecanvas/game-engine/blob/main/samples/pixelart/pixelart.js
474
- // or data can be a function with drawing operations
475
472
// see: https://github.com/litecanvas/game-engine/blob/main/samples/paint/paint.js
476
473
// the options are:
477
474
// * scale?: default is 1.
@@ -687,6 +684,10 @@ <h2><a id="engine-api">Engine API</a></h2>
687
684
// example: pal() resets the default color palette
688
685
pal(colors: string[]): void
689
686
687
+ // Swaps two colors of the current palette
688
+ // example: pal(0, 3) // now the color #0 is white and the color #3 is black
689
+ palc(a: number, b: number): void
690
+
690
691
// Loads a plugin.
691
692
// see: https://github.com/litecanvas/game-engine/blob/main/samples/plugin-basics/plugin-basics.js
692
693
use(callback): void
@@ -859,9 +860,9 @@ <h2><a id="tools">Useful tools</a></h2>
859
860
</ ul >
860
861
</ main >
861
862
862
- < footer >
863
+ <!-- < footer>
863
864
<a class="visitors-counter" href="https://hits.seeyoufarm.com"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Flitecanvas.js.org%2Fabout.html&count_bg=%2363C64D&title_bg=%236A7799&icon=&icon_color=%23E7E7E7&title=Visitors&edge_flat=false"/></a>
864
- </ footer >
865
+ </footer> -->
865
866
866
867
< script src ="prism/prism.js "> </ script >
867
868
< script src ="prism/prism-typescript.js "> </ script >
0 commit comments