(Just to clarify: I want the blue box to be placed like the brown box)
I am calculating the angle from** point A(green) **to **point B(center)
**
bluebox.x = (greendot.x - bluebox.width) + (Math.cos(angle) * (bluebox.width * 0.5));
bluebox.y = (greendot.y - bluebox.height) + (Math.sin(angle) * (bluebox.height * 0.5));
If the blue box was an circle instead, my example would work* (edge to edge),
*but now when I’m using squares instead, this problem occurs.
Any tips on how I can solve this is very appreciated!
*Thanks in advance,
Tompa
*