Kaplay.CustomComponent
Types
t
Creating a custom component is a way to extend the Kaplay engine with your own custom logic. See https://v4000.kaplayjs.com/guides/custom_components/
Be aware that
type t<'gameObj> = { id: string, require?: array<string>, add?: Js_OO.Callback.arity1<'gameObj => unit>, fixedUpdate?: Js_OO.Callback.arity1<'gameObj => unit>, update?: Js_OO.Callback.arity1<'gameObj => unit>, draw?: Js_OO.Callback.arity1<'gameObj => unit>, destroy?: Js_OO.Callback.arity1<'gameObj => unit>, inspect?: Js_OO.Callback.arity1< 'gameObj => Null.t<string>, >, drawInspect?: Js_OO.Callback.arity1<'gameObj => unit>,}
Fields
id string
require option < array >
add option < Js_OO.Callback.arity1 unit >
fixedUpdate option < Js_OO.Callback.arity1 unit >
update option < Js_OO.Callback.arity1 unit >
draw option < Js_OO.Callback.arity1 unit >
destroy option < Js_OO.Callback.arity1 unit >
inspect option < Js_OO.Callback.arity1 Null.t >
drawInspect option < Js_OO.Callback.arity1 unit >
Values
makeComponent
let make: t<'gameObj> => Kaplay.Types.comp