onLoad(action: ()=>void): KEventController | undefined

Register an event that runs when all assets finished loading.

since

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

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

Misc