defineComponent
defineComponent<
S>(schema,defaults?):Component<S>
defineComponent({ hp: u16, speed: f32 }, { hp: 3 }). Fields left out of world.add/spawn take their
default, or 0 when there is none.
Type Parameters
Section titled “Type Parameters”S extends Schema
Parameters
Section titled “Parameters”schema
Section titled “schema”S
defaults?
Section titled “defaults?”Partial<Record<keyof S, number>>
Returns
Section titled “Returns”Component<S>
