Hey,
Im currently trying to create a simple line renderer that connects two transforms (two other widgets), but I cant seem to get the conversion to the pixels correct.
Currently, I am doing the following:
// Setting the width of the sprite to be the distance between the two transforms
float width = Vector3.Distance(nguicamera.ViewportToScreenPoint(widgetTransform1.position),nguicamera.ViewportToScreenPoint(widgetTransform2.position));
lineSegmentSprite.SetDimensions((int)(width) , 32);
// Setting the sprite to be between the two transforms
lineSegment.transform.position = (transform1.position+transform2.position )/2.0f;
// Rotate the sprite
Using this method, the sprite is placed in the correct position between the widgets and rotated correctly, but the width is not correct (its sort of close, but off)
Any help with this would be great. Im probably doing something silly, but thanks
