hurrmmm/godot/UI/TAS UI/CurrentFrameLabel.cs

25 lines
597 B
C#
Raw Normal View History

2023-11-11 15:08:59 -07:00
using Godot;
using System;
public partial class CurrentFrameLabel : Label
{
TAS_System TAS;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
TAS = GetNode<TAS_System>("/root/TAS_System");
2023-11-11 15:47:37 -07:00
// TAS.FrameIncremented += OnFrameIncremented;
2023-11-11 15:08:59 -07:00
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
2023-11-11 15:47:37 -07:00
this.Text = $"Current frame: {TAS.CurrentFrame}";
2023-11-11 15:08:59 -07:00
}
public virtual void OnFrameIncremented(int newFrame)
{
this.Text = $"Current frame: {newFrame}";
}
}