In a top-down perspective, a character can have one speech bubble spawn near them. If there are multiple characters that are close to each other their speech bubbles that are drawn on screen space might overlap each other. So, to prevent that from happening, is there any viable method or approaches. For instance, I had searched about how to check if Widgets are overlapping but to no avail. Other than that, I think the biggest problem is to calculate a new position for the widgets if they are overlapped.
There’s no built-in method for this, you will need to do it manually. Get the size and position of each widget and mathematically figure out where others can be placed.
You did not include much details here but if it needs dynamic updates (widgets size changes on the fly or the speech bubbles move about a lot) you’ll need to do it during tick.
Could you quickly demonstrate a potential layout on the screen - a crude paint drawing will do! I’m wondering if there’s an automated method of doing it what you need.
Here what I am able to achieve. I get the average location between all actor that talks. When an actor talks, I first find a direction from the average location to the actor’s self-location. Using that direction, I add a certain amount of distance as the offset. This method kind of work when all actors that talk are in different directions.
Here is the issue when some actors are in the same direction.
I do think about the issue of how to get the size of the widget, the widgets are all dynamically spawned with the desired length. I also know that getting the desired draw size cant work as I had tested it myself and read it on another post in here. Not sure if there is another proper way of getting it. The bubble doesn’t need to update dynamically, just that it had a different length based on the content.