Editor

Since version 6.5, Castle Game Engine includes an Editor. Run it using the castle-editor executable in the bin subdirectory of the latest Castle Game Engine release.

The editor allows to:

  1. Create and build CGE projects.

    A Castle Game Engine project is just a directory containing the CastleEngineManifest.xml file. Most often it also contains a subdirectory data/ that is accessed from code using the castle-data:/xxx URLs. Everything else is up to you, organize your source code and data however you like.

    From the editor you can create a project using a number of templates. You can compile, run and package the project using the Run menu.

    Note that compiling and packaging a project can also be done using the command-line CGE build tool. Actually, the editor just calls the build tool under the hood. The build tool in turn calls a compiler (FPC) and some other tools (e.g. Android-specific packaging tools).

  2. Design user interfaces and 3D/2D transformation hierarchies.

    A design is a hierarchy of components descending from TCastleUserInterface (for user interfaces) or TCastleTransform (for 3D and 2D worlds). Each design is saved into a file with extension .castle-user-interface or .castle-transform and can be loaded at any point in your game using the UserInterfaceLoad or TransformLoad functions. E.g. UserInterfaceLoad('castle-data:/my-ui.castle-user-interface').

    You can also use TSerializedComponent class to efficiently load a design once, and instantiate it many times. There is also TUIState.InsertUserInterface, comfortable to insert UI into TUIState (which is typically used like a form in Lazarus/Delphi: each TUIState represents a functional user interface).

    Everything related to designing is in the editor Design menu (once you open any project). You can open any example project from the engine designed using the editor (e.g. examples/tiled/strategy_game_demo) and play around with it.

  3. Browse the files in your project. Double-click on files in the file browser at the bottom of the editor to:

    The tools, like view3dscene and castle-view-image are already distributed with CGE, so you don't have to install anything additional. Just double-click from the editor and it will run a suitable viewer.

More detailed documentation about the editor is here.

See also the movie about the editor:

The source code of the editor is inside tools/castle-editor subdirectory of sources. You can compile it yourself from Lazarus.