Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mod

This class describes a GDMod mod that can be returned by the JavaScript code. Using it has advantages:

  1. Other mods can interact with yours.
  2. The mod can be managed by GDMod, allowing for more control by the user and therefore a better UX.
  3. Fast and easy access to runtime callbacks.
example
class myMod extends Mod {
    preEvent(runtimeScene) {
        console.log("Hello World!");
    };
}

return myMod;

Hierarchy

  • Mod

Index

Constructors

constructor

  • new Mod(): Mod

Methods

postEvent

  • postEvent(runtimeScene: RuntimeScene): void
  • Function called after the scene event sheet.

    Parameters

    • runtimeScene: RuntimeScene

      The current scene.

    Returns void

preEvent

  • preEvent(runtimeScene: RuntimeScene): void
  • Function called before the scene event sheet.

    Parameters

    • runtimeScene: RuntimeScene

      The current scene.

    Returns void

sceneChanged

  • sceneChanged(runtimeScene: RuntimeScene): void
  • Function called when the scene switched.

    Parameters

    • runtimeScene: RuntimeScene

      The new scene.

    Returns void

unload

  • unload(): void
  • Function called when the mod should get unloaded, to allow it to clean things up.

    Returns void