diff options
| -rw-r--r-- | go/ui/textBox.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/go/ui/textBox.go b/go/ui/textBox.go index 7f8d75ee..c93e14e2 100644 --- a/go/ui/textBox.go +++ b/go/ui/textBox.go @@ -66,6 +66,12 @@ func (tb *TextBox) Centering(centering bool) *TextBox { return tb } +// UpdateText displays the new text in the TextBox. +func (tb *TextBox) UpdateText(new string) { + tb.text = new + tb.ForceRedraw() +} + func NewUnitInfo(x, y int, u *game.Unit) *TextBox { info := fmt.Sprintf("%s\nDamage: %d\nHealth: %d\nUpkeep: %d", u.String(), u.Damage(), u.Health, u.UpkeepCost()) |
