choosing different text for text boxes

0 favourites
  • 6 posts
From the Asset Store
Over 2700 files with all the colour combinations from a 15 colours palette!
  • I want to set and change a text object based on several different choices. Something like this:

    But, I want to have a lot more choices, say 100 for each blank. What would be a good way to go about doing this? I thought about using arrays but I don't know where to start.

    Thank you.

  • I'd go with a dictionary.

    It works like this:

    • Add the Dictionary object (obviously)
    • At the start of the layout (or whereever you prefer), add values to the dictionary
    • each value has a key, meaning you can get the value by inputting the key
    • this way you have multiple variants.

    Also, I'd be happy if you would provide the project context, so we know what object suits your purpose the most.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • randomly I've been playing around with dictionaries but I can't get it to work properly. Can you show me an example? Let's say that I want to have a text object, and each time I press a key it will change the text in the box for the size, color etc just like it would in my example image above using choose.

  • Here you go:

    (had much fun while doing this)

    Download .capx

  • I want to set and change a text object based on several different choices. Something like this:

    But, I want to have a lot more choices, say 100 for each blank. What would be a good way to go about doing this? I thought about using arrays but I don't know where to start.

    Thank you.

    Here is a Version using an Array, it should be easy to understand 3 Events 1 project file.

    The only advantage in using an array is that you can change the data on your server easily, as it is only a data file.

    http://www.sizzle-games.com/choose_array.capx

    I used this method for the levels in my game https://play.google.com/store/apps/details?id=com.sizzgames.BushyBall&hl=en_GB, to set the positions, width and size of the platforms e.t.c

    To edit the project file just double click it, it should open with notepad, then you can change the file data, just make sure if you change the size, to specify it in the file.

  • Thank you both. These have gotten me on the right track.

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