How do I get textbox instances to share text

0 favourites
  • 8 posts
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • I am making a RPG and I want the user to type into text boxes, After that I want them to go to another screen but be able to have the same boxes with the numbers they previously entered saved and on top of that be able to still type in them. Any method which would avoid me having to type a line of code for every box would be prefered but that's highly unrealistic. I am aware I could just have the text box setting its text to it's own text,

    eg system, every tick | set text (Textbox1) | Textbox1.text

    but that may cause problems allowing both text boxes to be typed in I want the first textbox to be typed in while on the first screen then the second instance to be typed in after that and the first one doesn't matter.

    TL:DR A your lazy its two paragraphs but I want to have a textbox keep its text through layouts

  • You could make it a global object, under object properties. Once you've set the text or typed the text in once, it'll keep its text between layouts.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Really I was messing with that but it didn't seem to work... I guess I will keep messing with it

  • Try to generate global variable with text value and when the user type when pressing a predefined telca set the value entered for the variable and in the other place to retrieve the value of the global variable ...

  • that would work but is there a way that doesn't involve a global variable for each box, at this point I probably have hundreds

  • If you're talking about what I think you're talking about then it's probably an inventory or some UI in an RPG that displays a bunch of stats between layouts. You can use arrays for storing stats in one object, you can then display the position of the array in a text box on start of each layout. Setting the textbox to be a global object to retain the text though should work though.

  • Another way I know, it would be via programming (PHP), but I do not know how to do it ... try to find tutorials about it ...

  • Ok thanks you two!

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