The Godot adapter embeds BlingoEngine into a Godot scene through a framework factory. Review ProjectSetup for the general registration flow, then apply the steps below for a Godot project:
- Install Godot 4 from the official website.
- Open
BlingoEngine.Demo.TetriGrounds.Godot.slnwith your C# IDE or open theproject.godotfile directly in Godot. - Ensure the Godot C# tools are configured. In the Godot editor, open
Project → Tools → C# and set the path to
dotnetif required. - Register the Godot factory in your root node and run the project:
using BlingoEngine.LGodot;
using BlingoEngine.Setup;
using Microsoft.Extensions.DependencyInjection;
public partial class RootNodeTetriGrounds : Node2D
{
private readonly ServiceCollection _services = new();
public override void _Ready()
{
_services.RegisterBlingoEngine(cfg => cfg
.WithBlingoGodotEngine(this, factory =>
{
// optional Godot factory configuration
})
.SetProjectFactory<BlingoEngine.Demo.TetriGrounds.Core.TetriGroundsProjectFactory>()
.BuildAndRunProject());
}
}The factory supplies Godot‑specific implementations for graphics, input and windowing before the project starts.
The BlingoEngine.Director.LGodot package exposes a classic Director-like
authoring environment. Register it instead of the plain factory when you want
the full windowed interface:
_services.RegisterBlingoEngine(cfg => cfg
.WithDirectorGodotEngine(this)
.SetProjectFactory<MyProjectFactory>()
.BuildAndRunProject());Stage dimensions define the playable stage area and are set in your
IBlingoProjectFactory implementation:
public void Setup(IBlingoEngineRegistration config)
{
config.WithProjectSettings(s =>
{
s.StageWidth = 640;
s.StageHeight = 480;
});
}In Godot, set Project Settings → Display → Window → Width/Height to values larger than the stage (for example, 1280×960) so the Director window has room for the interface.
For more details on how the factory wires everything together, see ProjectSetup.