iFactory.Godot/BITKit/Scripts/UX/UXProfiler.cs

19 lines
450 B
C#

using Godot;
using System;
namespace BITKit.UX;
public partial class UXProfiler : Node
{
[Export] private Label fpsLabel;
[Export] private Label resolutionLabel;
public override void _Process(double delta)
{
var windowSize = DisplayServer.WindowGetSize();
if (fpsLabel is not null)
fpsLabel.Text = $"FPS: {Engine.GetFramesPerSecond()}";
if (resolutionLabel is not null)
resolutionLabel.Text = $"{windowSize.X}x{windowSize.Y}";
}
}