Skip to content

Commit 3b73997

Browse files
committed
fix cheatsheet
1 parent e661d65 commit 3b73997

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

public/about.html

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -607,26 +607,12 @@ <h2><a id="math">Math</a></h2>
607607
// All arguments are required and must be numbers.
608608
colcirc(x1, y1, r1, x2, y2, r2): boolean</code></pre>
609609

610-
<h2><a id="plugin-api">Engine API</a></h2>
610+
<h2><a id="engine-api">Engine API</a></h2>
611611

612612
<pre><code class="language-typescript">// Loads a plugin.
613613
// see: https://github.com/litecanvas/game-engine/blob/main/samples/plugin-basics/plugin-basics.js
614614
use(callback): void
615615

616-
// Create or update an global variable (see above WIDTH, HEIGHT, etc)
617-
setvar(name: string, value: any): void
618-
619-
// Gets the color value given its index.
620-
// example: getcolor(0) returns "#111"
621-
getcolor(index: number): string
622-
623-
// Registers a game event callback and
624-
// returns a function that unregister this callback.
625-
listen(event: string, callback: Function): Function
626-
627-
// Triggers a game event and call its registered callbacks.
628-
emit(event: string, arg1?, arg2?, arg3?, arg4?): void
629-
630616
// Resizes the game canvas.
631617
// Also, emits the "resized" (use `listen` to observe this event).
632618
resize(width: number, height: number): void
@@ -639,7 +625,24 @@ <h2><a id="plugin-api">Engine API</a></h2>
639625
timescale(value: number): void
640626

641627
// Sets the target FPS at runtime
642-
setfps(value: number): void</code></pre>
628+
setfps(value: number): void
629+
630+
// the following functions are most used by plugins...
631+
632+
// Create or update an global variables (and instance properties)
633+
setvar(name: string, value: any): void
634+
635+
// Gets the color value given its index.
636+
// example: getcolor(0) returns "#111"
637+
getcolor(index: number): string
638+
639+
// Registers a game event callback and
640+
// returns a function that unregister this callback.
641+
listen(event: string, callback: Function): Function
642+
643+
// Triggers a game event and call its registered callbacks.
644+
emit(event: string, arg1?, arg2?, arg3?, arg4?): void
645+
</code></pre>
643646

644647
<h2><a id="advanced">Playground Features</a></h2>
645648

public/sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const cacheName = "luizbills.litecanvas-editor-v1";
2-
const version = "2.32.0";
2+
const version = "2.32.1";
33

44
const precacheResources = [
55
"/",

0 commit comments

Comments
 (0)