How to stop new label text overwriting old one?

Godot Version

4.1.1

Question

Hi! New to everything, and happy to be here.

I am wondering if there is a way to stop a new a label text overwriting the previous one.

I have a function that pulls a random entry from an array, and then displays a text accordingly.

Then I have another function, that runs that function 4 times, when a button is pressed.

The label is only displaying the most recent text, when it is run 4 times, when I want it display every iteration.

For context, think of the game as a dice game where a dice is picked and rolled several times.

Any help is welcome, many thanks.

How do you want to display every iteration? Do you want to have each text append the last one?
If yes, then please write something like this:
label.text += "\n" + new_text

\n = Create a new line

1 Like

Thank you kindly for the response!

Having += instead of = was what I was missing.

\n is a welcome bit of info too.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.