20 lines
466 B
C#
20 lines
466 B
C#
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);
|
|
}
|
|
} |