Populate list box entries with Y-axis of array/dictionary

0 favourites
  • 8 posts
From the Asset Store
Template for scrollable list, fully documented in comment and video
  • Hi,

    I want to player to click on the list box and see all the items in his inventory listed from the drop-down menu. The items are currently stored inside an array, with each item's name on the Y axis at X=0.

    I've tried the 'set text' and the At expression for my array, but nothing happens when I preview the game - list box stays empty.

    Thanks for any help with this :)

    Oh - I was wondering if there is a way to set this up so that the list box automatically populates for each item in the inventory, instead of programming the entries for every single array item?


  • That should do the trick

  • Thanks for this,

    My list is still showing up blank however when I click on it.

    Im trying to populate it with items from Y=1 to Last item at X=0 on the array

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmm, ohhh I misread that a little, instead of using "for each X element" use "for each X,Y element". If that doesn´t solve it... hard to tell what´s wrong without seeing the rest of the code/project.

  • Here's a screenshot of the array + the events. If populating a list box with array / dictionary text is gonna be difficult I'm happy to try a simpler method.

  • You gotta upload the image though :) After upload it shows something like

    Copy that ID and insert it like this


    (remove the *)

  • Thanks :->

  • You call the function after you requested the file via AJAX, but AJAX might take a moment to complete. So you call the function before the arrays are loaded. Put the function fall below "Load from JSON string" inside the On "INV" completed.

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