Interface Extension

All Known Implementing Classes:
DrawingExtension, GamepadExtension, RecorderExtension, SaveExtension, TiledExtension

public interface Extension
An extension: found through ServiceLoader (a line in META-INF/services/org.openpatch.scratch.extension.Extension) or registered with Window.use(...), installed once when the window is created. Learner code never sees it.

The metadata lives in code, not in a resource file, because the fat jar shades every first-party extension into one jar, where a fixed resource path would survive only once.

  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    The version of the core library, e.g.
    id()
    A short unique id such as "tiled", used in messages.
    default void
    Adds the extension's hooks.
    A name for people, such as "Tiled maps".
    default String
    The core versions this extension works with: "7" means any 7.x, "7.1" 7.1 or newer, "7.1.2" 7.1.2 or newer, always below the next major version.
    The extension's own version.
  • Method Details

    • id

      String id()
      A short unique id such as "tiled", used in messages.
    • name

      String name()
      A name for people, such as "Tiled maps".
    • version

      String version()
      The extension's own version.
    • requires

      default String requires()
      The core versions this extension works with: "7" means any 7.x, "7.1" 7.1 or newer, "7.1.2" 7.1.2 or newer, always below the next major version.
    • install

      default void install(ExtensionContext ctx)
      Adds the extension's hooks. Called once, on the window thread, before the first stage.
    • coreVersion

      static String coreVersion()
      The version of the core library, e.g. "7.0.0".