TX/T2DLinkPointComponent
From TDN
|
[edit] GetLinkPointGet interfaces for position and rotation of named link point, if link point exists. [edit] Example 1Here 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>();
|



