TX/T2DLinkPointComponent

From TDN

This page is a Work In Progress.


T2DLinkPointComponent
Add this component to a T2DSceneObject in order to add named link points to the object.

GetLinkPoint

Get interfaces for position and rotation of named link point, if link point exists.
to do

Example 1

Here is an example taken from here showing link points in action. This code gets all the links points of a T2DSceneObject.

            //The only thing it requires it the SceneObject that has all the link points attached to it
            //Returns an order list of points. That can be used for paths and other stuff
            bool endSearch = false;
            int i = 1;
            float linkRotation;
            Vector2 linkPosition;
            while (!endSearch)
            {
                String linkPointName = "LinkPoint" + i;
                i++;
                if (sceneObject.LinkPoints.HasLinkPoint(linkPointName))
                {
                    sceneObject.LinkPoints.GetLinkPoint(linkPointName, out linkPosition, out linkRotation);
                    float x = (sceneObject.WorldClipRectangle.Width / 2) * linkPosition.X;
                    float y = (sceneObject.WorldClipRectangle.Height / 2) * linkPosition.Y;
                    path.Add(new Vector2(x, y));
                }
                else
                {
                    endSearch = true;
                }
            }

//fields
private List<Vector2> path = new List<Vector2>();

T2DSceneObject