How do I make an action specific to a row of list boxes

  • Hi,

    I have a layout setup that will contain multiple list boxes in a row. Starting on the left you choose your first value (For example Fruit / Veg / Meat) and then this selection will populate the next list along depending on your choice. So if you choose Fruit, the second list in the row will then change to (Apples, Bananas.....)

    This then gives you price per unit and you can choose quantity.

    I have everything working for a row as I'd like but to make the rule work for multiple rows currently I need to choose "clone object type" past underneath and then copy all my "row1" code and do a replace all for the lists / boxes all the way along. It works but it doesn't seem a very efficient way of doing my app.

    I have not done much list / family / UID stuff in C2 so I have been trying to find (with no success) if there is a way I can create a set of rules for a row and then simple copy / past the row underneath. All I could think to relate a list to another is they would have the same .Y coord value.

    Any existing tutorials / examples / help would be appreciated =)

    A simple example of what I have so far is below:

    https://www.dropbox.com/s/wew0qksg21btu ... .capx?dl=0

    Thanks,

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • something like... List Example.capx ?

  • Hi korbaach

    Nice example/ Much cleaner than my one! Although if I copy and add a couple more rows all the values change in all the boxes. I am hoping to find a way so that I can have any amount of rows and it changes only that row.

    Thanks,

  • I can't open your capx because it uses a plugin I don't have installed currently, and I'm lazy about installing plugins.

    It sounds just like a picking issue, namely picking two different instances of the same object type. You can find solutions for that elsewhere on the forum. One thing you could do instead is loop through the list objects and save the current selection to a variable so the next one would have a value to compare to.

    To have multiple independent rows you could pick by y first then loop over them by x.

    https://dl.dropboxusercontent.com/u/542 ... _list.capx

  • R0J0hound

    Thanks a million! Exactly what I was after. Just need to implement it with my text lists but I'll play around and sort that.

    Appreciate the help!

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