From 645d1083fecf707a56b07c1fd52df4015885d9ce Mon Sep 17 00:00:00 2001 From: Sophia Pearson Date: Sun, 4 Sep 2022 13:29:53 +0200 Subject: game: add StatusLine behavior --- Scripts/Game/StatusLine.cs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Scripts/Game/StatusLine.cs (limited to 'Scripts/Game/StatusLine.cs') diff --git a/Scripts/Game/StatusLine.cs b/Scripts/Game/StatusLine.cs new file mode 100644 index 0000000..4a3fb23 --- /dev/null +++ b/Scripts/Game/StatusLine.cs @@ -0,0 +1,30 @@ +using Godot; + +namespace Texty.Scripts.Game +{ + public class StatusLine : PanelContainer + { + private string _titleText = "Title Text"; + + [Export] + public string Title + { + get => _titleText; + set + { + if (TitleLabel != null) + TitleLabel.Text = value; + _titleText = value; + } + } + + public RichTextLabel TitleLabel; + + public override void _Ready() + { + TitleLabel = GetNode($"%{nameof(TitleLabel)}"); + TitleLabel.Text = _titleText; + } + } +} + -- cgit v1.2.3