It would be really nice if AC had a built in Unity UI for using speech bubbles (for subtitles).
It seems quite a popular ask here on the forum and getting positioning and sizing to work properly seems to be no small feat
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
My understanding is that it's mainly a styling topic - what is the main issue beyond using AC's "Above Speaking Character" position option, in conjunction with Unity's content resizing components?
Yes, this is totally a styling topic. But one that seems surprisingly hard to pull off and fairly common in these types of games.
Challenges:
It still sounds like a case of using Unity's UI components to handle the bulk of things, with a script to handle some of the finer details e.g. the tip position.
Do you have mockup images / screenshots to show more clearly the intent? This may be suited for a downloadable template.
This repro illustrates a size related problem that actually occurs using both regular subtitles (when shown above speaker) and when using speech bubbles:
https://1drv.ms/u/s!Amz_vh8OYDX3vOJYmY6arLBUNMiHcQ?e=Un98th
Play to see the problem in action
I'll take a look.
TextMeshPro has a convenient GetPreferredValues, which can be used to get the width/height of a TMPro component given a string. This can be used to work out if the RectTransform boundary needs to be shunk or not. If so, you can then also have AC update the Menu's position to avoid a momentary glitching while it resizes:
Ah, Interesting solution - thanks!
While I'm not a fraction of the coder that @kloot is*, the speech bubbles for our game are still a little more primitive than I'd like, and they took literally months and help from @ChrisIceBox to get up and running, so I'd def. reiterate the suggestion for a template, or maybe a tutorial or wiki entry.
*or of any coder, really
A template would be most appropriate, IMO. In what way does yours differ from the above, @MartynEm?