Class

Asset

:

An asset is a resource that is loaded asynchronously. It can be a sprite, a sound, a font, a shader, etc.

loaded

: boolean
static

loaded

(data: D) => Asset<D>

data

: D | null

error

: Error | null
private

onLoadEvents

:
private

onErrorEvents

:
private

onFinishEvents

:

onLoad

(action: (data: D) => void) => this

onError

(action: (err: Error) => void) => this

onFinish

(action: () => void) => this

then

(action: (data: D) => void) => Asset<D>

catch

(action: (err: Error) => void) => Asset<D>

finally

(action: () => void) => Asset<D>
kaplay logo

Layer

Miscalenous