Sprite::extension()
Browser availability: desktop-only.
For extensions, which run against the desktop's window and render threads. The browser ships its extensions natively and loads no others.
An extension's state for this sprite, made on first use; a clone gets its own. For extensions, not for learner code.
Syntax
Java
.extension(type, factory)
Parameters
| Name | Data Type | Description |
|---|---|---|
| type | Class<T> | the state's class |
| factory | Supplier<T> | makes it |
Return
T