Quick Start

This page will help you hit the ground running by setting up a basic list

The asset has a built-in "Quick Start" that will create a basic list for you to get started. To get started:

  1. Create a Canvas object.

  2. Create a new UI object under the Canvas.

  3. Add Component -> Hud Feed List

  4. Select the Hud Feed List and at the bottom of the inspector you should see a Quick Start button. Click it.

You should have a basic list now! It uses the IconTextHudFeedListItem as the list item type. You can add things to the list using the following code snippet:

using TS.HudFeed;
using TS.HudFeed.Common;
using UnityEngine;

public class ListHandlerComponent : MonoBehaviour
{
    public HudFeedList ListComponent;

    public string ListItemKey = "MyListItem";
    public string Text = "Item Text";
    public Sprite Icon;

    public void Start()
    {
        AddItem(Text, Icon);
    }

    public void AddItem(string text, Sprite iconSprite)
    {
        if (ListComponent != null)
        {
            ListComponent.Enqueue(ListItemKey, new IconTextData
            {
                Icon = iconSprite,
                Text = text
            });
        }
    }
}

Add the above component to a gameObject in your scene and test it out!

Don't forget to drag and drop the HudFeedList into the ListHandler's ListComponent property

Where do I go from here?

Now that you have a basic list set up it is time to make it your own! Check out some of the other docs based on what you want to do:

Last updated