PNode.Position Method 

Animate this node's matrix to one that will make this node appear at the specified position relative to the specified bounding box.

public virtual void Position(
   PointF srcPt,
   PointF destPt,
   RectangleF destBounds,
   int millis




The source point specifies a point in the unit square (0, 0) - (1, 1) that represents an anchor point on the corresponding node to this matrox. The destination point specifies an anchor point on the reference node. The position method then computes the matrix that results in transforming this node so that the source anchor point coincides with the reference anchor point. This can be useful for layout algorithms as it is straightforward to position one object relative to another.

For example, If you have two nodes, A and B, and you call

PointF srcPt = new PointF(1.0f, 0.0f);
PointF destPt = new PointF(0.0f, 0.0f);
A.Position(srcPt, destPt, B.GlobalBounds, 750);
The result is that A will move so that its upper-right corner is at the same place as the upper-left corner of B, and the transition will be smoothly animated over a period of 750 milliseconds.

See Also

PNode Class | UMD.HCIL.Piccolo Namespace