onLoad(action: ()=>void): void

Register an event that runs when all assets finished loading.

sincev2000.1

const bean = add([
    sprite("bean"),
])

// certain assets related data are only available when the game finishes loading
onLoad(() => {
    debug.log(bean.width)
})
kaplay logo

3001.0.0-alpha.18

Misc