How do people prevent a frame from exiting a circular boundary?

If you’ve played Deathrun, there is a radial menu used for emotes, and can be triggered by pressing E. Their system has a dot synced with the cursor (not what I’m asking for), and if your mouse goes beyond the menu (it’s circular), the dot clamps/prevents itself from going beyond the frame.

https://gyazo.com/d19c84bf5da5f7b67df74bb0aa091aee

Thanks.

Given the position of the center of the circle, and its radius, you can check the distance from the frame to the center and if it’s greater than the radius then you can prevent it from going any further if it is.

2 Likes

Will look into it.
30 ccccccccccccccccccc