How do I create a global variable to make user's text input appear on the next layout?

0 favourites
  • 5 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Hi all, I'm trying to create something very basic, but I'm a noob and can't figure it out :) So HERE I have in layout 1 a inputtext field and a button and a text box on Layout 2. I want the user to input their name or other information, click the button to go to the next layout and have what they input in Layout 1 pop up on layout 2.

    I tried following what Lancifer suggested:

    "As for the TextInput solution, the easiest way is to create a global variable for it and save the text when you leave the current layout. Then, you just need to call the variable when you get to the next layout.

    For example, make a global variable called InputText. Then, use whatever event that ends the layout to set InputText to whatever the textbox had in it. Like this...

    -> System: Set InputText to TextInput.Text

    Now, when you go to the next layout, you call for the InputText variable with a text object or whatever you got planned."

    where am I going wrong in my project?

  • Not a clue. We can't open the Construct 3 editor to see YOUR project. It doesn't work that way.

    Save your project and share it like you did in the other thread that you're quoting me from.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see the problem.

    In event sheet 1, you've got "Set InputText to TextInput.Text" on start of layout. That won't work because nothing has been input yet.

    It needs to be moved to the button on clicked event, just above the go to Layout 2.

    In event sheet 2, you have "Set text to TextInput.Text" which is also incorrect. You need to set text to the global, which is InputText.

  • Thank you so very much!!!! I'm trying to create interactive quizzes in which students input their names and answers, so this has helped me tremendously! Thanks again!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)