How do I populate a UI element from an array?

0 favourites
  • 2 posts
From the Asset Store
🙌 Element Magic Hit Sound Pack comes with 805 high-quality sound effect
  • I've edited the post so it's a bit more succinct... I do tend to go overboard with my typing. Also I'm probably asking a bit much.

    I'm currently trying to learn arrays for a mech game I'm creating. Each mech uses the same group of object types and gets all of their data in the form of stats, which animation to use, weapons etc from two global arrays.

    I've got accessing arrays down, but I'm still a little fuzzy on looping through them. What I want to do is loop through a certain part of the mech array, which stores which weapons are in weapon slots, and determine how many non-zero entries I have in there (and resize a Weapon List UI element based on that), and then for each non-zero entry somehow create a new 'UI listing' with the weapon name, weapon cool down, weapon ammo etc. Kind of like this:

    How would I go about doing this, do you think?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's what the two arrays look like:

    Sorry for double-posting...

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