How can I the amount of things in a UIListLayout?

Hi :slight_smile:

I am wondering if I can get some help with the following…

I have a radio system which does the basics and uses constriants to make a chat system. When a player is on a team and types, it broadcasts to clients with their message. It’s essentially just a team chat. My issue is I need to cut messages once they get to a certain point. Do you have any idea how I can do this?

image
(How I want it to be)

image
(What happens right now)

image
(This is how it’s laid out)

Is there any way to detect when it passes a certain point or maybe a way to tell what order number it is?

1 Like

Why could you not just keep a table of frames, insert a frame to the end of the table every time, and if the length of the table is greater than say 6 as in your example delete and remove the first element of the table?

Edit: If you haven’t done the ordering yet make the layoutorder of every new element the layoutorder of the last added element or 0 + 1.

1 Like

Change the LayoutOrder to “name” and set the set the TextLabel’s name to “A - NameHere”. Then, number your frames. Under the properties window, select “LayoutOrder”, and select name.

If you intend on a line count greater than 10, be sure to put a 0 before any number less than 10 to preserve the layout (i.e. preventing a skip: 08,09,10,11,12 instead of 1,11,12,13,–> 2,3,4).

Edit: If you want to cut a message, you can:

  • Enable “ClipsDescendants” in an enclosing frame
  • Enable “TextTruncate” in the TextLabels that have the text

Alternatively, you can:

  • Enable “TextScaled” in the TextLabels to forcibly scale down size so that the entire transmission can be seen
  • Enable “TextWrapped” in the TextLabels to break longer transmissions into multiple lines still contained within the TextLabel.
1 Like