Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

PrefabOptions

PrefabOptions = PrefabBaseOptions & object & BodyDeclaration

What a prefab declares: its traits, its model, and its body and collider, a collider with no body being a fixed body. A convexHull() with no points is its model’s hull, so it names a model.

Name Type Description
model? string The registered model each entity is drawn as.
view? EntityView | false How each entity is drawn on a page, over the model: a component handed the entity, drawn where it stands, or false to draw none. The same view draws an entity of the prefab placed in a scene, one a system spawned and one a room streams. A room never mounts it. The prefab’s module imports the view, so a view that imports the prefab back makes a cycle: keep the traits in a module of their own.