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

19 lines
450 B
C#
Raw Normal View History

2023-11-02 20:58:36 +08:00
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)
2023-11-30 00:27:34 +08:00
resolutionLabel.Text = $"{windowSize.X}x{windowSize.Y}";
2023-11-02 20:58:36 +08:00
}
}