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:
Create a Canvas object.
Create a new UI object under the Canvas.
Add Component -> Hud Feed List
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!
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:
If your list item needs are more complex than a simple text + image then you should check out Creating Your Own List Items
If you want to change how the list presents its items take a look at its Settings / Configuration documentation.
If you want to create your own animations for each of your list items you should check out Creating List Item Animations
If you just want to see what else you can do with HudFeedList check out the Examples
Last updated