Skip to content

Commit b1fce04

Browse files
committed
update engine
1 parent 13cfa7b commit b1fce04

File tree

9 files changed

+245
-238
lines changed

9 files changed

+245
-238
lines changed

public/about.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,6 @@ <h2><a id="settings">Game Configuration</a></h2>
359359
// can pass a number to determine a maximum scale.
360360
settings.autoscale = true
361361

362-
// If `true`, the pixel art images won't look blurry.
363-
// Also, disables canvas built-in antialias.
364-
settings.pixelart = true
365-
366362
// exposes all methods and properties (see below)
367363
// in the global scope
368364
settings.global = true
@@ -466,12 +462,13 @@ <h2><a id="drawing">Functions for Drawing</a></h2>
466462
*/
467463

468464
// 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
470470

471471
// 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
475472
// see: https://github.com/litecanvas/game-engine/blob/main/samples/paint/paint.js
476473
// the options are:
477474
// * scale?: default is 1.
@@ -687,6 +684,10 @@ <h2><a id="engine-api">Engine API</a></h2>
687684
// example: pal() resets the default color palette
688685
pal(colors: string[]): void
689686

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+
690691
// Loads a plugin.
691692
// see: https://github.com/litecanvas/game-engine/blob/main/samples/plugin-basics/plugin-basics.js
692693
use(callback): void
@@ -859,9 +860,9 @@ <h2><a id="tools">Useful tools</a></h2>
859860
</ul>
860861
</main>
861862

862-
<footer>
863+
<!-- <footer>
863864
<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> -->
865866

866867
<script src="prism/prism.js"></script>
867868
<script src="prism/prism-typescript.js"></script>

public/index.html

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -131,46 +131,6 @@ <h1>Litecanvas</h1>
131131
/>
132132
</svg>
133133
</button>
134-
<button
135-
type="button"
136-
id="copy"
137-
title="Copy the code"
138-
aria-label="Copy the code"
139-
>
140-
<svg
141-
xmlns="http://www.w3.org/2000/svg"
142-
fill="none"
143-
width="24"
144-
height="24"
145-
stroke-width="1.5"
146-
stroke="currentColor"
147-
>
148-
<path
149-
stroke-linecap="round"
150-
stroke-linejoin="round"
151-
d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"
152-
/>
153-
</svg>
154-
</button>
155-
<a
156-
id="gh"
157-
title="Github"
158-
aria-label="Github"
159-
href="https://github.com/litecanvas"
160-
target="_blank"
161-
rel="nofollow noopener"
162-
>
163-
<svg
164-
role="img"
165-
width="24"
166-
height="24"
167-
xmlns="http://www.w3.org/2000/svg"
168-
>
169-
<path
170-
d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
171-
/>
172-
</svg>
173-
</a>
174134
<button
175135
type="button"
176136
id="screenshot"

public/js/app.js

Lines changed: 47 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)