ProgramImplementation

open class ProgramImplementation(val suspend: Boolean = false) : Program

The Program class, this is where most user implementations start.

Constructors

Link copied to clipboard
fun ProgramImplementation(suspend: Boolean = false)

Types

Link copied to clipboard
inner class ApplicationClipboard : Clipboard
Link copied to clipboard
inner class Window : Window

Simplified window interface

Functions

Link copied to clipboard
fun animate(animationFunction: Animatable.() -> Unit)
Link copied to clipboard
open override fun draw()

This is the user facing draw call. It should be overridden by the user.

Link copied to clipboard
open override fun drawImpl()

This is the draw call that is called by Application. It takes care of handling extensions.

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

install an Extension

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

install an Extension and configure it

open override fun extend(stage: ExtensionStage, userDraw: Program.() -> Unit)

install an extension function for the given ExtensionStage

Link copied to clipboard
open suspend override fun setup()

This runs exactly once before the first call to draw()

Properties

Link copied to clipboard
open lateinit override var application: Application
Link copied to clipboard
open override var assetMetadata: () -> AssetMetadata
Link copied to clipboard
open override var assetProperties: MutableMap<String, String>
Link copied to clipboard
open override var backgroundColor: ColorRGBa?

background color that is used to clear the background every frame

Link copied to clipboard
open override val clipboard: ProgramImplementation.ApplicationClipboard
Link copied to clipboard
open override var clock: () -> Double

clock function. defaults to returning the application time.

Link copied to clipboard
val deltaTime: Double

The elapsed time since the last draw loop

Link copied to clipboard
open override val dispatcher: Dispatcher
Link copied to clipboard
open lateinit override var drawer: Drawer
Link copied to clipboard
open lateinit override var driver: Driver
Link copied to clipboard
open override var ended: Event<ProgramEvent>

program ended event

Link copied to clipboard
open override val extensions: MutableList<Extension>

list of installed extensions

Link copied to clipboard
open override var frameCount: Int = 0
Link copied to clipboard
open override var height: Int = 0
Link copied to clipboard
open override var isNested: Boolean = false

This is checked at runtime to disallow nesting extend blocks.

Link copied to clipboard
open override val keyboard: Keyboard
Link copied to clipboard
open override val mouse: ApplicationMouse
Link copied to clipboard
open override var name: String
Link copied to clipboard
open override val pointers: Pointers
Link copied to clipboard
open override val produceAssets: Event<ProduceAssetsEvent>
Link copied to clipboard
open override val program: Program
Link copied to clipboard
open override val requestAssets: Event<RequestAssetsEvent>
Link copied to clipboard
open override val seconds: Double

The number of seconds since program start, or the time from a custom clock. value is updated at the beginning of the frame only.

Link copied to clipboard
val suspend: Boolean = false
Link copied to clipboard
open override var userProperties: MutableMap<String, Any>

A map that can be used to store arbitrary data, including functions

Link copied to clipboard
open override var width: Int = 0
Link copied to clipboard
open override val window: ProgramImplementation.Window

Sources

Link copied to clipboard