Build the editor from source
The editor in the download is built with C# and Avalonia, from
engine/editor/avalonia. This page builds it from source on macOS, to change
it or to run code newer than the release.
What it has
Section titled “What it has”The workspace tabs sit at the top of the window.
| Tab | What it does |
|---|---|
| 2D | Pans, zooms, picks and moves an Entity2D, with Select, Rotate, Scale and Pan tools, snap, a grid and rulers. |
| 3D | Draws the scene through the engine. A drag orbits, the wheel zooms and a click picks. The gizmo moves, rotates and scales. |
| Script | Edits a project .cs file with colours, an outline and completion on Ctrl+Space or a typed dot. |
| Graph | Edits .ograph graph scripts and stops on a breakpoint at a step. Your first graph script starts here. |
| Game | Runs the project and shows its monitors and live scene tree. |
Across the tabs it has these.
- A launcher when no project is named. It lists recent projects and makes a new one from a template.
- A command palette on Cmd+K. Shift+Cmd+O opens a scene by name.
- Undo and redo of scene edits, listed in the History tab.
- An inspector that shows every property of an entity’s class and edits several entities at once. Its Signals tab connects signals and its Import tab reimports a file.
- Project > Export, with Download Templates and an install from a
.tpzon disk. Export a game covers the templates. - C# debugging under netcoredbg, covered below.
1. Build the engine library
Section titled “1. Build the engine library”- Install Xcode’s command line tools and SCons.
- Get the source at the 1.3.0 tag:
git clone --branch v1.3.0 https://github.com/ChxisB/orblit.git- From the
orblitfolder, build the engine as a library:
scons platform=macos target=editor dev_build=yes library_type=shared_library- Build the program too. The editor runs it to play the project:
scons platform=macos target=editor dev_build=yesCheck: bin/liborblit.macos.editor.dev.arm64.dylib and
bin/orblit.macos.editor.dev.arm64 exist. On an Intel Mac the names end in
x86_64 in place of arm64. Set ORBLIT_ENGINE_LIBRARY to use a library
from another path. The program must sit beside it.
2. Run the editor
Section titled “2. Run the editor”- Install the .NET 10 SDK.
- From
engine/editor/avalonia, copy the sample project. The editor saves into the project it opens.
cp -R Orblit.Editor.Bridge.Checks/Fixtures/view_demo ~/view_demo- From the same folder, start the editor on the copy:
dotnet run --project Orblit.Editor.App -- --project ~/view_demoCheck: the editor opens on main.oscn, and the engine window opens beside it.
| Option | What it does |
|---|---|
--project <folder> |
Opens that project. With no project, the launcher opens. |
--scene <res:// path> |
Opens that scene. The default is res://main.oscn. |
--headless |
Runs the engine with no window, so the viewport stays empty. |
3. Build the program with C#
Section titled “3. Build the program with C#”Skip this if your games use no C#. The library stays without C#. Play runs the program beside it that was built last, so a C# game needs a program built with C#.
- From the
orblitfolder, build the program with the C# module:
scons platform=macos target=editor dev_build=yes module_csharp_enabled=yes- Make the C# glue:
bin/orblit.macos.editor.dev.arm64.csharp --headless --generate-csharp-glue engine/modules/csharp/glue- Build the C# assemblies into
bin/OrblitSharp:
./engine/modules/csharp/build_scripts/build_assemblies.py --orblit-output-dir=bin --orblit-platform=macosCheck: bin/OrblitSharp exists, and bin/orblit.macos.editor.dev.arm64.csharp --version
prints a version with csharp in it.
4. Debug C#
Section titled “4. Debug C#”- Install netcoredbg. The editor does not include it.
- Put it on your
PATH, or setORBLIT_NETCOREDBGto its path. - Open a
.csfile in the Script tab and click in the gutter beside a line. A breakpoint appears. - Run the project.
Check: the game stops on the line. The editor opens the script there, and the Debugger tab shows the stack and the locals. Its buttons pause, continue and step.
Without netcoredbg, the Debugger tab shows the game’s process id, so an outside IDE can attach.
