This is one of those issues which is trivial to draw and absurdly awkward to describe verbally, so please look forward to some absurdly bad MS Paint illustrations.
Now, I’m trying to write a system which will give me coordinates to position speech bubbles. When an NPC speaks, I convert their location in world space to screen space, and end up with a Vector2 screenPosition, which most closely approximates each NPC’s location.
For the purposes of playability and making the dialogue easier to read, I want every dialogue bubble to eventually live somewhere in a circle around the player model, as illustrated in these lovely schematics.
Speech bubbles start out at screenPosition, the WorldToScreenCoordinates of the character speaking:
Bubbles get snapped to the position in said circle that is closest to their starting location:
So I’m really confused about how I need to accomplish this- there is no literal circle, it’s just a conceptual space on the screen, so how do I actually derive a Vector2 coordinate representing “The closest point to this bubble’s starting transform on a circle of r radius originating from screen center”?