@@ -607,26 +607,12 @@ <h2><a id="math">Math</a></h2>
607607// All arguments are required and must be numbers.
608608colcirc(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
614614use(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).
632618resize(width: number, height: number): void
@@ -639,7 +625,24 @@ <h2><a id="plugin-api">Engine API</a></h2>
639625timescale(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
0 commit comments