Hey Construct world! Hope you're all doing well.
I've searched through the previous threads of people asking about how to create a data grid/table and most answers/suggestions are 5-9 years old and relate to C2 (or the link to the example is DOA).
I want to create a 4 row, 3 column table with data. What is the best approach?
Thank you in advance!
You'll need AJAX and an Array Object in your project.
Right click the 'Files' folder in the project tab, pick 'New -> Array'.
Set width to 4 and height to 3. Then put the data you want in each cell.
In the event sheet:
'On Start of Layout
-AJAX -> Request Project File (pick the name of the array.json you made. Tags can be whatever)
-System -> Wait for Previous Actions
-Array -> Load -> AJAX.LastData'
This uses AJAX to load in the array from the file you made. Then, when finished loading, the Array object copies its contents by grabbing the last data loaded through the AJAX object.
To check if it worked, use the 'Debug Layout' mode. Click the 'Array' object you made on the list. If it shows you a section called 'Data' with cells that match the ones from the file, you're good to go.
From there, how you choose to visualize the data in the game depends on what you're using it for.
Develop games in your browser. Powerful, performant & highly capable.
Brilliant suggestion and work. Heading off to the lab to test. Updates to come. Thank you!