ExtensionHost

Represents a host for managing and executing extensions within a program. This interface provides methods for adding, configuring, and executing extensions at different stages of the program's lifecycle.

Inheritors

Properties

Link copied to clipboard

A mutable list of extensions associated with the host. Extensions allow adding custom behavior or extending the functionality of the framework at various lifecycle stages such as setup, before draw, and after draw.

Link copied to clipboard
abstract val keyboard: KeyEvents
Link copied to clipboard
abstract val mouse: MouseEvents
Link copied to clipboard
abstract val pointers: Pointers
Link copied to clipboard
abstract val program: Program

Functions

Link copied to clipboard
abstract fun <T : Extension> extend(extension: T): T

Adds an extension to the host and returns the extension instance. The extension allows customization or extension of the host's functionality at various lifecycle stages such as setup, before draw, and after draw.

abstract fun <T : Extension> extend(extension: T, configure: T.() -> Unit): T

Adds an extension to the host and applies a configuration block to it. This method allows customization or extension of the host's functionality by invoking a user-defined configuration on the provided extension.

abstract fun extend(stage: ExtensionStage = ExtensionStage.BEFORE_DRAW, userDraw: Program.() -> Unit)

Adds an extension to the program that executes a user-defined block of code at a specified extension stage. The execution stage can be SETUP, BEFORE_DRAW, or AFTER_DRAW. This method prevents nesting of extend calls.