extend
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.
Return
The same extension instance that was added.
Parameters
The extension instance to be added to the host.
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.
Return
The configured extension instance.
Parameters
The extension instance to be added and configured.
A lambda function defining the configuration to be applied to the extension.
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.
Parameters
The stage in the program's lifecycle where the extension will be executed.
The block of code to be executed as part of the extension.