Initial commit
This commit is contained in:
20
source/Scripts/DebugScreen.cs
Normal file
20
source/Scripts/DebugScreen.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Godot;
|
||||
|
||||
public partial class DebugScreen : Control {
|
||||
public static DebugScreen? Instance { get; private set; }
|
||||
|
||||
[Export]
|
||||
public RichTextLabel? Text { get; set; }
|
||||
|
||||
private string layout = string.Empty;
|
||||
public override void _Ready() {
|
||||
layout = Text!.Text;
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public override void _Process(double delta) {
|
||||
var text = layout;
|
||||
Text!.Text = layout.Replace("{FPS}", Engine.GetFramesPerSecond().ToString());
|
||||
base._Process(delta);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user