Question by
Entretoize · Aug 20, 2017 at 08:22 PM ·
algorithmtransforms
Position/scale a sprite knowing two top corner positions
Hello, I am calculating two points and need a sprite to be positioned so that its two top corners are on these two points. The method I see is first calculate the angle with Vector2.signedAngle, scale using the distance between the two points, calculate the top left corner position of the sprite with transform.TransformPoint, calculate the difference with the first calculated point and translate.
Is there a simpler solution ?
Thanks
Comment