I am currently trying to create a subtitle system, So whenever a NPC talks, subtitles appear on the bottom. If multiple are talking, they stack on-top of each other.
I have been searching forever and the closest I can find is people who have already done it but not listed how. It’s been about a day and half now sense I first tried making it.
This is somewhat like what I’m attempting to create.
I personally would put the subtitle TextLabels inside a central frame in the bottom center of the screen, then use a UIGridLayout constraint to manage the spacing however you would like. Be sure to have this parented to the frame, and just insert a new subtitle in once that is complete.
The pink frame is “SubtitleFrame”, and be sure to have UIGridLayout’s FillDirection as “Vertical” to display them in vertical order. Once you are finished with one subtitle, you can remove it, and the positions of all other subtitles will adjust accordingly because of the UIGridLayout.
I would suggest using a UIListLayout, as you have the ability to change the size of the subtitle frame as it is added into the main frame unlike using a UIGridLayout where you are stuck to using the pre-assigned properties.
Great catch! The reason why I opted for UIGridLayout is because often times you would want to have all of your sizes Uniform. You can change the size in the GridLayout’s property box instead of having vastly different sized elements. However, in this case, subtitles often times do increase in size depending on how much text is needed.
That works great! One issue however, I would like to tween them as they go up for a smooth animation. Do you know anyway to do that? (Yes I know basic tween-ing I’m just wondering how to tween it as it goes up)