showing text one at a time.

How do I show objects appearing one at a time, when someone presses a button? I’m stuck at making a story for the game and I need the text to show up when needed, not all at once.

1 Like

You can do it with variables example.
When variable “text” is 0 → Do: “once upon a time…” to the text of “Story”
SubEvent: When pressing x, Timer “next text” is over 1, trigger once → do variable “text” to 1, Reset timer “next text”

When variable “text” is 1 → Do: “There was a Jubeliuksen3…” to the text of “Story”
SubEvent: When pressing x, Timer “next text” is over 1, trigger once → do variable “text” to 2, Reset timer “next text”

Etc.

There is “modify the text” under text object in the actions.

hi,

you could create an even that adds 1 to a variable when your key is pressed (make sure to add the “trigger once” condition as well) and setup your events so the first text appears when variable is equal to 1, the second one when variable is equal to 2, and so forth.

There are many ways of doing that with a variable-adding trick. You could for example move a single text object and change its text and visibility whenever the key’s pressed.

I’m still new at using GDeveloper engine, i don’t know how to use these variables and what they do :confused:

Here’s a very small example I made that may help.
A variable is a number or text that holds information. It can be a players ammo. It could be how much health you have left. Or even use them to display text boxes in a certain order. In Gdevelop there are events that can make, check and change variable numbers or texts in the “Variables” tab in the events and actions.
Hopefully the example can help! :smiley:
Project.gdg (12.3 KB)