diff options
| author | Sophia Pearson <codergal89@gmail.com> | 2022-09-04 13:29:53 +0200 |
|---|---|---|
| committer | Sophia Pearson <codergal89@gmail.com> | 2022-09-04 13:29:53 +0200 |
| commit | 645d1083fecf707a56b07c1fd52df4015885d9ce (patch) | |
| tree | 3415e9ccd9e3c3dfbb382d08583816b0d2836f3d /Scripts/Game | |
| parent | 6503e483766d3a4e1907ecd9b69e7db4e86e7cb6 (diff) | |
| download | texty-645d1083fecf707a56b07c1fd52df4015885d9ce.tar.xz texty-645d1083fecf707a56b07c1fd52df4015885d9ce.zip | |
game: add StatusLine behavior
Diffstat (limited to 'Scripts/Game')
| -rw-r--r-- | Scripts/Game/StatusLine.cs | 30 |
1 files changed, 30 insertions, 0 deletions
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<RichTextLabel>($"%{nameof(TitleLabel)}"); + TitleLabel.Text = _titleText; + } + } +} + |
