Set List Data

Overview

The Set List Data Node allows the user to set the data of a List in a Scene2D.

This Node requires that the JSON data is in Array format. Refer to the example at the bottom of the page.

Scope: Scene, Function, Prefab.

Inputs

Outputs

Example

For correct formatting, start with the desired JSON file. Here we have an example:

   [
    {
        "icon": "Users/user.name/Documents/Project1/Assets/image1.jpg",
        "text": "you collected"
    },
    {
        "icon": "Users/user.name/Documents/Project1/Assets/image2.png",
        "text": "over 9000"
    },
    {
        "icon": "Users/user.name/Documents/Project1/Assets/image3.png",
        "text": "overhours"
    }
]

This needs to be placed into an Array. Go into the Logic Editor and populate an Array with the elements of the desired JSON using your preferred method.

The full Array would look like this if outputted to the Console:

[ { icon:Users/user.name/Documents/Project1/Assets/image1.jpg, text:you collected }, { icon:Users/user.name/Documents/Project1/Assets/image2.png, text:over 9000 }, { icon:Users/user.name/Documents/Project1/Assets/image3.png, text:overhours } ]

Each element is encapsulated by {} symbols, like in the JSON. The "" are not necessary here. Simply use an A:B format with a comma separating the lines of each element.

The resulting List should look like this in the Player:

See Also

Last updated