0 Favourites

Store text, and recall it

  • Hi,

    I have tried various things with the variables, but could not get it working.

    At the first layout, there is a textbox where a person fill in their name.

    In later layout, I want to have a text with: Hello (filledinname).

    Getting that information from the previous layout is not working.

    Probably I have to it with the set text to: "Hi " & name.

    Like here scirra.com/forum/a-health-and-limit-in-one-text_topic46973.html

    I know have the problem to get the data from the form correctly.

    I think it can be very simple, but not found a good solution yet, thanks!

  • You'd want to set the custom name to a global variable, or a global array object, depending on how many other variables you want to share across layouts.

    You can create global variables by right mouse clicking in an event sheet and selecting "Add global variable" from the drop down menu (you can call it "PlayerName" for easy reference). Then, in your events handling name input, once the player gives the OK you can set the global variable "PlayerName" to whatever the player input their name as. Then later on, when you have your dialogue event, you can set the text string as

    "Hi " & PlayerName

    Global variables are called just as you named them, without any quotes.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I know what you mean, but I have trouble with setting up the inserted text as global variable. This part 'you can set the global variable "PlayerName" to whatever the player input their name as. '

    Here is also the project file:

    dropcanvas.com/lyy9z

    Thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic Locked topic
223 15,829
Tom's avatar
Tom Construct Team Founder
Unread hot topic
0 Favourites
[Plugin] tag text
188 25,446
RBuster's avatar
RBuster
Unread hot topic
118 32,901
rexrainbow's avatar
rexrainbow