Skip to content

Physics Plus and Light Theme

S.U.P.E edited this page Nov 6, 2026 · 1 revision

Physics Plus and Light Theme

Two small packages that are also the best examples to learn package writing from.

Physics Plus

Package physics_plus · version 1.0.0 · Editor and Game · category Physics

Adds physics quality and gravity presets. Add it to a project and the chosen preset ships with the exported game (its settings.json lives in the project's packages/physics_plus folder).

Tools (Packages menu)

Each tool cycles through its presets; the label shows the current one.

Physics quality: …

Preset Steps / second Substeps Solver iterations
Normal 60 2 4
High (package default) 120 2 8
Ultra 120 4 14

Normal is the engine's own default. Higher quality makes stacking and fast objects more stable at the cost of CPU time.

Gravity: …

Preset Gravity (m/s²)
Earth −9.81
Mars −3.71
Moon −1.62
Low −4.0

How it works

The whole package is about 40 lines. It sets PhysicsWorld.FIXED_DT, SUBSTEPS and SOLVER_ITERATIONS, sets engine.physics.gravity, and stores the choice with h3d.settings / h3d.save_settings(). Read packages/physics_plus/engine.py as your first package example.


Light Theme

Package light_theme · version 1.0.0 · Hub and Editor · category Theme

A clean light look for the Hub and the editor. Install it, press Restart now on the Packages page, and switch it Off to go back to dark.

  • hub.py calls hub.set_theme({...}) with every Hub colour key.
  • engine.py calls h3d.theme(...) with the editor's THEME keys:
h3d.theme(
    bg="#EEF0F3", panel="#F8F9FB", panel_dark="#E3E6EB", border="#CDD2DA",
    button="#E2E5EA", button_hover="#D5DAE2", selected="#C9DBFA",
    accent="#2F6FD6", accent_dim="#A9C6F7", play_green="#3E9B57", green_text="#2E7D46",
    danger="#D14343", danger_hover="#E05252",
    text="#1F2328", text_bright="#0B0D10", text_dim="#5E6673",
)

Copy it to make your own colour theme.

See also

Packages · Writing Packages · Physics

Clone this wiki locally