iFactory.Godot/BITKit/Scripts/Node2D/DateTimeNode.cs

15 lines
363 B
C#
Raw Normal View History

2023-06-15 21:52:13 +08:00
using Godot;
using System;
using System.Globalization;
namespace BITKit;
public partial class DateTimeNode : Label
{
[Export]
private string timeFormat;
public override void _Process(double delta)
{
Text = string.IsNullOrEmpty(timeFormat) ? DateTime.Now.ToString(CultureInfo.InvariantCulture) : DateTime.Now.ToString(timeFormat);
}
}