Add Godot project shell

This commit is contained in:
2026-04-21 18:54:38 +02:00
parent 0d9957fa62
commit 12a2868c9c
17 changed files with 424 additions and 6 deletions

View File

@@ -0,0 +1,43 @@
#nullable enable
using Godot;
namespace SideScrollerGame.Debug;
public partial class DebugOverlay : CanvasLayer
{
public override void _Ready()
{
Layer = 100;
ProcessMode = ProcessModeEnum.Always;
EnsureLabel();
}
public void SetStatus(DebugSettings settings, string loadedSceneId)
{
Label label = EnsureLabel();
label.Text = $"Debug boot: {settings.BootMode}\nSeed: {settings.Seed}\nScene: {loadedSceneId}\nDebug: {OS.IsDebugBuild()}";
}
private Label EnsureLabel()
{
if (m_StatusLabel is not null)
{
return m_StatusLabel;
}
m_StatusLabel = GetNodeOrNull<Label>("StatusLabel");
if (m_StatusLabel is null)
{
m_StatusLabel = new Label { Name = "StatusLabel" };
AddChild(m_StatusLabel);
}
m_StatusLabel.MouseFilter = Control.MouseFilterEnum.Ignore;
m_StatusLabel.Position = new Vector2(8.0f, 8.0f);
m_StatusLabel.AutowrapMode = TextServer.AutowrapMode.Off;
return m_StatusLabel;
}
private Label? m_StatusLabel;
}