Skip to content

Commit

Permalink
fix cheatsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
luizbills committed Oct 27, 2024
1 parent e661d65 commit 3b73997
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
35 changes: 19 additions & 16 deletions public/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -607,26 +607,12 @@ <h2><a id="math">Math</a></h2>
// All arguments are required and must be numbers.
colcirc(x1, y1, r1, x2, y2, r2): boolean</code></pre>

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

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

// Create or update an global variable (see above WIDTH, HEIGHT, etc)
setvar(name: string, value: any): void

// Gets the color value given its index.
// example: getcolor(0) returns "#111"
getcolor(index: number): string

// Registers a game event callback and
// returns a function that unregister this callback.
listen(event: string, callback: Function): Function

// Triggers a game event and call its registered callbacks.
emit(event: string, arg1?, arg2?, arg3?, arg4?): void

// Resizes the game canvas.
// Also, emits the "resized" (use `listen` to observe this event).
resize(width: number, height: number): void
Expand All @@ -639,7 +625,24 @@ <h2><a id="plugin-api">Engine API</a></h2>
timescale(value: number): void

// Sets the target FPS at runtime
setfps(value: number): void</code></pre>
setfps(value: number): void

// the following functions are most used by plugins...

// Create or update an global variables (and instance properties)
setvar(name: string, value: any): void

// Gets the color value given its index.
// example: getcolor(0) returns "#111"
getcolor(index: number): string

// Registers a game event callback and
// returns a function that unregister this callback.
listen(event: string, callback: Function): Function

// Triggers a game event and call its registered callbacks.
emit(event: string, arg1?, arg2?, arg3?, arg4?): void
</code></pre>

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

Expand Down
2 changes: 1 addition & 1 deletion public/sw.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const cacheName = "luizbills.litecanvas-editor-v1";
const version = "2.32.0";
const version = "2.32.1";

const precacheResources = [
"/",
Expand Down

0 comments on commit 3b73997

Please sign in to comment.