Skip to content

API reference

Every CRUMB component is built from the same tools you have. Its behaviour lives in two pieces of code you write in the component editor, and this reference lists everything that code can use.

You don’t write either class. In each code editor you type fields, the hooks you override and your own helper methods, with no class, using or namespace lines. Everything on BaseCircuitLogic is yours to use by name in circuit logic, and everything on BaseComponentLogic in component logic. What you write has the rules your code follows.

  • Circuit logic is the electrical half: pins, conductances, sources, currents and voltages. It never touches the physical world.
  • Component logic is the mechanical and visual half: it reads the circuit, moves and lights the model, applies forces and senses the world through the members CRUMB generates for your model.

The two halves only exchange plain numbers, through UserData. See How a component works for the rules and Building components for how the pieces fit together.

  • The whitelist: exactly which namespaces and types each half may use, the methods tied to one hook, and the errors CRUMB gives.
  • Circuit logic: The electrical half of a component. Everything on BaseCircuitLogic is yours to use by name, and you stamp into the CircuitSimulation through Simulation. Circuit logic is purely electrical: no bodies, no positions, no forces.
  • Component logic: The mechanical and visual half of a component. Everything on BaseComponentLogic is yours to use by name. It reads the circuit through Circuit and works with your model through the members your markers give it.
  • Model and world: The types component logic works with: the nodes of your model, rigid bodies, sensors, displays and wires, and the value types Vector2, Vector3, Vector4 and Color. CRUMB generates a member for each node you mark, such as Rendering.Wheel or Interactivity.Button, so you rarely name these types yourself.

Generated from the CRUMB source, commit fcec660d, 2026-10-29.