melonJS
    Preparing search index...

    Class CapacitorPlugin

    melonJS plugin that bridges Capacitor's native lifecycle and hardware-back events into the engine. Register via plugin.register(CapacitorPlugin, "capacitor", options?) — the Capacitor wiring is installed automatically on registration.

    The instance is then accessible at plugin.cache.capacitor; call instance.teardown() to detach all listeners (typically only needed for hot-reload or unit tests).

    Hierarchy

    • BasePlugin
      • CapacitorPlugin
    Index
    app: Application

    a reference to the app/game that registered this plugin

    teardown: () => Promise<void>

    Detach every Capacitor listener wired by this plugin. Returns a promise that resolves once all remove() calls have settled — await it from tests / hot-reload paths for deterministic cleanup, or fire-and-forget for opportunistic detachment.

    version: string

    define the minimum required version of melonJS this can be overridden by the plugin